Forked from braddalton/Add Genesis Search Box To Primary Nav Menu.php
Last active
April 16, 2019 14:19
-
-
Save wpspeak/6057190 to your computer and use it in GitHub Desktop.
Add Genesis Search Box to Secondary Menu
This file contains hidden or 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 Genesis search form to secondary menu | |
add_filter( 'wp_nav_menu_items', 'genesis_search_secondary_nav_menu', 10, 2 ); | |
function genesis_search_secondary_nav_menu( $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
Credit: http://wpsites.net/web-design/add-search-form-to-any-genesis-nav-menu/