WordPress.org

Ready to get started?Download WordPress

Forums

Only show search widget on home page (10 posts)

  1. drew8818
    Member
    Posted 3 years ago #

    I want to have my search widget only show up on my home page. What code do I need to place and where? Thanks

  2. vtxyzzy
    Member
    Posted 3 years ago #

    Take a look at the Widget Logic plugin.

  3. drew8818
    Member
    Posted 3 years ago #

    Thanks. I downloaded the plugin, but unsure of what code to insert into the widget logic field?

  4. vtxyzzy
    Member
    Posted 3 years ago #

    Try this:

    if (is_front_page()) { return true; } else { return false; }

  5. drew8818
    Member
    Posted 3 years ago #

    This code makes the search bar disappear from all pages. Any thoughts?

  6. vtxyzzy
    Member
    Posted 3 years ago #

    Please check your coding carefully. If it is correct, try changing is_front_page to is_home.

  7. drew8818
    Member
    Posted 3 years ago #

    This did not work. I tried both options, and it either disappeared from every page, showed up on every page, or provided a parse error. Any other ideas?

  8. vtxyzzy
    Member
    Posted 3 years ago #

    Here is the EXACT code I am using, and it works!

    if (is_front_page()) { return true; } else { return false; }

  9. drew8818
    Member
    Posted 3 years ago #

    Didn't work. But thank you for trying to help me. Much appreciated!

  10. vtxyzzy
    Member
    Posted 3 years ago #

    Why don't you try switching to the Twenty Ten theme to see if it is a theme-related issue?

Topic Closed

This topic has been closed to new replies.

About this Topic