WordPress.org

Ready to get started?Download WordPress

Forums

is_single()/is_home() not working in external files (1 post)

  1. maneeshnanu
    Member
    Posted 2 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic