[wp-hackers] wp_enque_script and conditional tags

scribu scribu at gmail.com
Sat Jul 19 22:54:19 GMT 2008

Hello! I am having a problem with conditional tags:

add_action('init', 'js_loader');

function js_loader(){
  if ( is_home() )
    wp_enque_script('script_name', 'script_src', array('dependencies'));

The condition in the if clause is never true. What should I change to
enque a script only on the home page?


More information about the wp-hackers mailing list