Support » Fixing WordPress » is_single()/is_home() not working in external files

  • I have created a css.php file.
    and depending on the condition i have to set the styles.
    though it work fine in wordpress,
    but i need to check if the present page is home page or not.for this there is method is_home() in wordpress, but it returns 1 for every page(for home as well as for non home page),and is_single() doesn’t return any output .
    include(“../../../wp-blog-header.php”); get included without any problem
    i hv tried including query.php
    include(“../../../wp-includes/query.php”); but it shows error.

    what can i do to access is_home()/is_front_page() method in external file?

  • The topic ‘is_single()/is_home() not working in external files’ is closed to new replies.