Created
January 26, 2018 17:16
-
-
Save hu0p/73c39992e4e4097c785e094865c94d0d to your computer and use it in GitHub Desktop.
Adding search to Wordpress Navigation
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','add_search_box', 10, 2 ); | |
function add_search_box( $items, $args ) { | |
$items .= '<li class="primary-nav_searchbar">' . 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