Add attributes to WordPress Nav Menu Links (a tag)»
This can be very useful if you need to add attributes for a menu script. /** * Add custom attribute and value to a nav menu item's anchor based on…
Nav Menu, WP/CP | Type: PHP
Add search form to specific nav menu»
add_filter('wp_nav_menu_items', 'add_search_form', 10, 2); function add_search_form($items, $args) { if( $args->theme_location == 'MENU-NAME' ) $items .= '<ul> <li class="search"> <form id="searchform" role="search" action="'.home_url( '/' ).'" method="get"><input id="s" name="s" type="text" value="search"><input id="searchsubmit"…
Nav Menu, Search | Type: PHP