• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Winning Agent Pro Search Bar to show only on homepage?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Winning Agent Pro Search Bar to show only on homepage?

This topic is: resolved

Tagged: search bar, winning agent pro

  • This topic has 8 replies, 3 voices, and was last updated 9 years, 3 months ago by Ben Siegfried.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • February 25, 2014 at 5:18 pm #92360
    Ben Siegfried
    Member

    WordPress 3.8.1
    Winning Agent Pro

    How would I get the Search Bar (.search-bar) to appear only on the homepage? As the theme is set up it show on every page.

    February 25, 2014 at 10:55 pm #92397
    Brad Dalton
    Participant

    That question may be better asked on the theme Developers website as its hard to test solutions when its not included in the Pro Plus Package. Thanks https://store.winningagent.com/support/

    You could try using a plugin like Widget Logic and add the conditional tag

    is_front_page()

    to the header widget.


    Tutorials for StudioPress Themes & WooCommerce.

    February 25, 2014 at 11:16 pm #92408
    Ben Siegfried
    Member

    Isn't the hook area used for the .search-bar one that would appear on every page? I understand hooks to some degree…

    I haven't used widget logic, I'll take a look at it.

    February 26, 2014 at 1:38 am #92433
    Brad Dalton
    Participant

    Probably but not certain because i don't own the theme.

    You could add a conditional tag after the function.

    Otherwise, you can send me a copy of the theme and i'll take a look in the code and work out a solution which doesn't involve the need to install a plugin. [email protected]


    Tutorials for StudioPress Themes & WooCommerce.

    February 27, 2014 at 12:10 am #92608
    Brad Dalton
    Participant

    Simply replace the code around Line 160 of your child themes functions.php file with this code:

    This displays only on the front page.

    The home page varies according to what you set in the Reading Settings as your posts page. It can be your blog page.


    Tutorials for StudioPress Themes & WooCommerce.

    February 27, 2014 at 8:45 am #92671
    Ben Siegfried
    Member

    Thanks Brad!

    February 27, 2014 at 8:45 am #92672
    webcami
    Participant

    I just did this!

    // Add search widget below header.
    add_action( 'genesis_after_header', 'wap_search_bar' );
    function wap_search_bar() {
    genesis_widget_area( 'search-bar', array(
    'before'=> '<div class="search-bar"><div class="wrap">',
    'after' => '</div></div>',
    ) );
    }

    Remove this code from the functions.php and place it in the front-page.php. I didn't just do this alone, though. See the other changes I made here:

    Winning agent primary nav on homepage

    February 27, 2014 at 1:57 pm #92718
    Ben Siegfried
    Member

    I removed the add_action from the functions file and then added the following to the front-page file and it didn't work, no search-bar container shows.


    // Add search widget below header.
    add_action( 'genesis_after_header', 'wap_search_bar' );
    function wap_search_bar() {

    genesis_widget_area( ‘search-bar’, array(
    'before'=> '<div class="search-bar"><div class="wrap">',
    'after' => '</div></div>',
    ) );
    }

    February 27, 2014 at 1:59 pm #92720
    Ben Siegfried
    Member

    Oh geez, got it to work, quotes around 'search-bar' genesis_widget_area( ‘search-bar’, array( were wrong.

    Shoulde be genesis_widget_area( 'search-bar', array(

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble