Therecetas


add_filter( 'wp_nav_menu_items', 'dcms_item_search', 10, 2);

function dcms_item_search( $items, $args ) {

	if ($args->theme_location == 'primary') {

		$items .= '<li class="menu-item item-search">'
				. '<form role="search" method="get" class="search-form" action="'.home_url( '/' ).'">'
				. '<label>'
				. '<span class="screen-reader-text">' . _x( 'Buscar:', 'label' ) . '</span>'
				. '<input type="search" class="search-field" placeholder="' . esc_attr_x( 'Buscar …', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" title="' . esc_attr_x( 'Search for:', 'label' ) . '" />'
				. '</label>'
				. '<input type="submit" class="search-submit" value="" />'
				. '</form>'
				. '</li>';
	}

	return $items;
}