Trouble with is_front_page and is_home (3 posts)

  1. Jack
    Posted 4 years ago #

    I made a custom homepage template and set this as my homepage in settings > reading > static front page. My blogpage is set the same way settings > reading > blog pages.

    Now I'm using the pluging widget logic in the sidebar to show and hide two widgets. But when I use is_home() those two widgets will show up on the frontpage AND on the first blogpage. When I use is_front_page() both widgets don't show up.

    How can I get those widgets (with red and green background color) to show up ONLY on the frontpage, and not on the normal first blogpage?

    Frontpage: Frontpage JackTummers.nl
    Blogpage: Blogpage JackTummers.nl

  2. Michael
    Forum Moderator
    Posted 4 years ago #

    made a custom homepage template

    are you using any query in that template?
    if so, have you reset the query with wp_reset_query() ?


    generally, is_front_page() should be the right conditional tag to use


  3. Jack
    Posted 4 years ago #

    Damn! You're right! I didn't reset the query. :)

Topic Closed

This topic has been closed to new replies.

About this Topic