Created
March 16, 2015 03:51
-
-
Save jayshreehcl/2f9694e9521bf89266db to your computer and use it in GitHub Desktop.
You can learn more about this function on my blog post .. http://wpvkp.com/add-search-form-to-secondary-navigation-menu-in-genesis/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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