Created
February 23, 2017 05:28
-
-
Save AminulBD/7e8be1e533096af1e4366a88d7dcb2d1 to your computer and use it in GitHub Desktop.
Add search form to the menu item
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','dt_corpo_search_box_to_menu', 10, 2 ); | |
function dt_corpo_search_box_to_menu( $items, $args ) { | |
if( $args->theme_location == 'main' ) | |
$items .= '<li id="menu-search-form">' . get_search_form( false ) . '</li>'; | |
return $items; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment