Created
February 8, 2019 05:35
-
-
Save braddalton/1e3310550ed2f8f052d56820f384f003 to your computer and use it in GitHub Desktop.
Foodie Pro - Reposition Search Box Before Nav Menu https://wp.me/p1lTu0-iiR
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
add_filter( 'wp_nav_menu_items', 'foodie_pro_search_primary_nav_menu', 12, 2 ); | |
function foodie_pro_search_primary_nav_menu( $menu, $args ) { | |
if ( 'primary' !== $args->theme_location || genesis_get_option( 'nav_extras' ) ) { | |
return $menu; | |
} | |
$search = sprintf( '<li id="foodie-search" class="foodie-search menu-item">%s</li>', | |
genesis_search_form( false ) | |
); | |
return $search . $menu; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment