Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created September 3, 2012 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save billerickson/d0644aa57b5934263349 to your computer and use it in GitHub Desktop.
Save billerickson/d0644aa57b5934263349 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'wp_nav_menu_items', 'be_subnav_search', 10, 2 );
/**
* Search in Secondary Navigation
* @author Bill Erickson
* @link http://www.billerickson.net/genesis-wordpress-nav-menu-content/
*
* @param string $menu
* @param array $args
* @return string
*/
function be_subnav_search($menu, $args) {
if ( 'secondary' !== $args['theme_location'] )
return $menu;
return $menu . '<li class="right">' . get_search_form( false ) . '</li>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment