Forums

[resolved] If is_home don't work (4 posts)

  1. h3o
    Member
    Posted 1 year ago #

    Hello everybody,

    I have a problem with IF statement

    I want to display some content only on home page and I've tried

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I get <p>NOT homepage content</p> on homepage

    I am going crazy with this

  2. David Gwyer
    Member
    Posted 1 year ago #

    What do you have under reading settings for 'Your latest posts' etc?

    Also, what theme template file are you adding the is_home() code to?

  3. alchymyth
    The Sweeper
    Posted 1 year ago #

    also, what else is in the template before the if-statement?
    any custom queries?
    custom queries without proper restoring of the original query are quite often the cause for conditional tags 'not working'.

    link to your site?

  4. h3o
    Member
    Posted 1 year ago #

    Custom query was a problem...

    <?php wp_reset_query(); ?> after loop end everything is ok.

    Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic