Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
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

1 Answer 1

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

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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