• Hi,

    Is it possible to load the js in wp_head only for home or index only? I tried is_home() and is_front_page() but still doesn’t work.

    I also tried adding the <?php wp_reset_query(); ?> and it doesn’t work either.

    By the way, I’m using the add_action event: add_action('wp_enqueue_scripts', 'my_enqueue_scripts');

    Does anyone guys there have an idea on how to accomplish this?
    Any help would be much appreciated.

    Thanks in advance.

Viewing 1 replies (of 1 total)
  • Thread Starter eugenealegiojo

    (@eugenealegiojo)

    Hey guys,

    Just got it fixed. I only need to place my js to the footer section so that is_home() works perfectly.

Viewing 1 replies (of 1 total)
  • The topic ‘Load the js in wp_head for home or index only, possible?’ is closed to new replies.