• Skip to main content
  • Skip to primary sidebar
  • Business
  • WordPress
  • Security
  • Marketing
  • Publicity
  • Computing
  • Resources
  • Whatevs

Purely Wordpress

Just The Tech, News, and Info We Deem To Post

  • Home
  • About
  • Contact
  • Contribute
You are here: Home / Code Snippets / Restore Search to Genesis Primary Navigation

Restore Search to Genesis Primary Navigation

Genesis Theme Framework Code Snippets

Add the following code to your theme’s function.php file, or a functionality plugin to restore the Search Box to the Genesis Primary Navigation.

//* Restore Right Side Primary Nav Search
add_filter( 'wp_nav_menu_items', 'theme_menu_extras', 10, 2 );
function theme_menu_extras( $menu, $args ) {
	//* Change 'primary' to 'secondary' to add search form to the secondary navigation menu
	if ( 'primary' !== $args->theme_location )
		return $menu;
	$menu  .= '<li class="right search">' . get_search_form( false ) . '</li>';
	return $menu;
}

by Jack Alltrade on June 5, 2019

Filed Under: Code Snippets, Genesis Framework Tagged With: Genesis Framework, Primary Navigation

Reader Interactions

Share Your Two Cents Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Categories

  • Code Snippets
  • Development
  • File Management
  • Genesis Framework
  • Hosting
  • Legacy
  • Plugins
  • SEO
  • Tech Terms
  • Themes
  • User Experience
  • User Interface
  • WordPress Core
  • WordPress Functionality

Warning! Use at your own risk!

As always, use at your own risk and remember to backup your site prior to inserting new code.

© Copyright Jack Alltrade & Associates 2025 · Purely Supplemental™ is a trademark of Jack Alltrade & Associates