• 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

How to add "Better Search" to Nav bar

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 › How to add "Better Search" to Nav bar

This topic is: not resolved
  • This topic has 2 replies, 2 voices, and was last updated 10 years, 5 months ago by Victor Font.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • August 26, 2015 at 8:19 am #163568
    nhed
    Member

    Hi,

    I'm using Altitude Pro theme and need to add "Better Search" to the Primary Nav Menu that show up in the header.

    I assume that I need to add code to the functions.php file.

    Could someone point me to the code that I would have to add to have the Better Search show up just to the right of the nav menu?

    I would like it to appear next to the hamburger mobile menu in the narrower screen resolutions and not on a separate row for mobile and tablets.

    Any hep would be greatly appreciated. Thanks once again.
    Ed

    http://www.join-ed.com
    August 26, 2015 at 8:21 am #163569
    nhed
    Member

    This is the code I'm using to add the native WP search to the header, but I don't like the results I've seen from this search function, so am looking at Better Search as a solution.

    Here's the code for the native WP search:

    add_filter( 'wp_nav_menu_items', 'theme_menu_extras', 10, 2 );
    /**
    * Filter menu items, appending either a search form or today's date.
    *
    * @param string $menu HTML string of list items.
    * @param stdClass $args Menu arguments.
    *
    * @return string Amended HTML string of list items.
    */
    function theme_menu_extras( $menu, $args ) {
    //* Change 'primary' to 'secondary' to add extras to the secondary navigation menu
    if ( 'primary' !== $args->theme_location )
    return $menu;
    //* Uncomment this block to add a search form to the navigation menu
    
    ob_start();
    get_search_form();
    $search = ob_get_clean();
    $menu .= '<li class="right search">' . $search . '</li>';
    
    //* Uncomment this block to add the date to the navigation menu
    /*
    $menu .= '<li class="right date">' . date_i18n( get_option( 'date_format' ) ) . '</li>';
    */
    return $menu;
    }
    
    August 26, 2015 at 2:35 pm #163612
    Victor Font
    Moderator

    I've got a pretty classy looking search on my site and it's one I duplicated with a different color scheme for http:://yellowwoodgroup.com/. Take a look, if you like it, here is a tutorial: http://victorfont.com/do-you-like-this-sites-search-bar/


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 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

© 2026 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