Skip to content

Instantly share code, notes, and snippets.

@vivek-kumar-poddar
Created February 14, 2017 05:33
Show Gist options
  • Save vivek-kumar-poddar/020129bdb1288d1bc386185651cbc496 to your computer and use it in GitHub Desktop.
Save vivek-kumar-poddar/020129bdb1288d1bc386185651cbc496 to your computer and use it in GitHub Desktop.
<?php
// Add search form to secondary navigation in genesis.
add_filter( 'wp_nav_menu_items', 'g_search_right_nav', 10, 2 );
function g_search_right_nav( $menu, stdClass $args ){
if ( 'secondary' != $args->theme_location )
return $menu;
if( genesis_get_option( 'nav_extras' ) )
return $menu;
$menu .= sprintf( '<li class="secondary-search">%s</li>', __( genesis_search_form( $echo ) ) );
return $menu;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment