WordPress.org

Ready to get started?Download WordPress

Forums

Trouble with is_front_page and is_home (3 posts)

  1. Jack
    Member
    Posted 2 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. alchymyth
    Forum Moderator
    Posted 2 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() ?

    http://codex.wordpress.org/Function_Reference/wp_reset_query

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

    http://codex.wordpress.org/Conditional_Tags

  3. Jack
    Member
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic