Support » Alpha/Beta/RC » is_home() or is_front_page() to check home.php

  • I recently wanted to enqueue a script to be used specificically on the home page. Using the template home.php, is_home() or is_front_page() does not seem to detect if home.php is in use. I also tried is_page_template( 'home.php' ) for the heck of.

    The solution ended up being if( home_url() ) { ... }. It seems like is_home() or is_front_page() should detect if home.php is in use, which is essentially the home page, hence is_home().

    Thought I would bring this up and see if I’m missing something or if this should be included in one of the various “home” checks.

  • The topic ‘is_home() or is_front_page() to check home.php’ is closed to new replies.