From f3dc4c227dcdd8a43e0db93c322e3b61ed1477a4 Mon Sep 17 00:00:00 2001 From: Ian Stewart Date: Tue, 14 Feb 2012 16:10:45 +0000 Subject: [PATCH] _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 --- functions.php | 11 +++++++++++ header.php | 1 - image.php | 1 - 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index e394a0f9..abda88c6 100644 --- a/functions.php +++ b/functions.php @@ -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' ); diff --git a/header.php b/header.php index aaaa5fe3..239a3a8a 100644 --- a/header.php +++ b/header.php @@ -35,7 +35,6 @@ ?> -