_s: move scripts into one function added to wp_enqueue_scripts
git-svn-id: https://wpcom-themes.svn.automattic.com/_s/@8936 d957f892-c61d-0410-b221-f235e6eecf30
This commit is contained in:
parent
0d87fcd173
commit
f3dc4c227d
3 changed files with 11 additions and 2 deletions
|
@ -100,8 +100,19 @@ add_action( 'widgets_init', '_s_widgets_init' );
|
|||
* Enqueue scripts
|
||||
*/
|
||||
function _s_scripts() {
|
||||
global $post;
|
||||
|
||||
wp_enqueue_script( 'jquery' );
|
||||
|
||||
wp_enqueue_script( 'small-menu', get_template_directory_uri() . '/js/small-menu.js', 'jquery', '20120206', true );
|
||||
|
||||
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
||||
wp_enqueue_script( 'comment-reply' );
|
||||
}
|
||||
|
||||
if ( is_singular() && wp_attachment_is_image( $post->ID ) && ! is_admin() ) {
|
||||
wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );
|
||||
}
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', '_s_scripts' );
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue