• drew8818

    (@drew8818)


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

Viewing 9 replies - 1 through 9 (of 9 total)
  • vtxyzzy

    (@vtxyzzy)

    Take a look at the Widget Logic plugin.

    Thread Starter drew8818

    (@drew8818)

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

    vtxyzzy

    (@vtxyzzy)

    Try this:

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

    Thread Starter drew8818

    (@drew8818)

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

    vtxyzzy

    (@vtxyzzy)

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

    Thread Starter drew8818

    (@drew8818)

    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?

    vtxyzzy

    (@vtxyzzy)

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

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

    Thread Starter drew8818

    (@drew8818)

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

    vtxyzzy

    (@vtxyzzy)

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Only show search widget on home page’ is closed to new replies.