• I have created a blank page named blog and specified it to be the posts page in the Reading > settings with a static home page. I am using tabs in the post page sidebar and want the javascript file to only load on those pages.
    This is what I am using in the functions file to load the script:

    add_action('wp_print_scripts', 'enqueueMyScripts');
    function enqueueMyScripts(){
        if( is_page('Blog') ) {
             wp_enqueue_script('tabs', get_bloginfo('template_url').'/js/tabber-minimized.js', false, '1.0', true);
       }
    }

    This does not work on the posts page but does work on any other page. I have tried changing ‘Blog’ to ‘blog’, ‘Home’ and ‘home’.
    Nothing works. Is there another way to get the script to load just for the posts pages?

The topic ‘Load a javascript only on blog page’ is closed to new replies.