0

I have a problem with is_home(). It is placed in my footer.php and it returns true when it shouldn't. I have a page template on which I perform a query with query_posts().

When I pass the following as the argument,

array( 'cat' => $lekarz_page_cat_id, 'paged' => get_query_var('paged') )

it returns false which is ok, but when the argument is

array('post__in' => $pz_posts, 'paged' => get_query_var('paged'))

it returns true when it shouldn't. Can someone tell me why this is so?

  • 3
    if you are using query_posts() in a template (not recommended, rather use get_posts() or WP_Query() ), you might need to end this with wp_reset_query(); to reset the querystring to the original. – Michael Dec 5 '11 at 12:58
2

If you are using a static page for your homepage. Then you should be using is_front_page();. Check this link -> http://codex.wordpress.org/Conditional_Tags

  • No I wasn't use static page as my homepage but now i'am and it works fine with is_front_page();. big THX – partyzant Dec 5 '11 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.