Question

I'd like to replace my:

    if(is_home())
    {
        wp_enqueue_script( 'homestuff', get_theme_part( THEME_JS . '/home.js' ), array( 'jquery' ), null, true );
        wp_enqueue_script( 'jquerycolor', get_theme_part( THEME_JS . '/jquery.color.js' ), array( 'jquery' ), null, true );
    };

Which is currently in header.php, by putting it in a functions.php file instead. Trying to tidy everything up on a sprawling client's site. I'm using wp-framework and ideally would stick this inside the enqueue_assets function in the main parent_theme class. Although this isn't really a wp-framework issue, I'd just like to know:

How can I get is_home() to work from a functions file? Is there an alternative, using globals, I need to know about?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top