Answer the question
In order to leave comments, you need to log in
Trouble displaying Wordpress menu button?
I add a pop-up search to the WordPress menu here: cg91812-wordpress-3.tw1.ru And it seems to work, but it prevents the button background from being displayed correctly, the style of which is defined in style.css HEADER, and it seems the button style falls into place intended for the menu text. Is it possible to get rid of the background, or hide it, but is it better to make it independent of the search button only??? as?
and also, how to push all this search button over the menu ??
search button added via functions.php:
// menu-search-form.
function add_search_to_wp_menu ( $items, $args ) {
if( 'primary' === $args -> theme_location ) {
$items .= '<li class="menu-item menu-item-search">';
$items .= '<form method="get" class="menu-search-form" action="' . get_bloginfo('home') . '/"><p><input class="text" type="text" value="Кто Ищет, Тот Найдет !" name="s" id="s" onfocus="if (this.value == \'Кто Ищет, Тот Найдет !\') {this.value = \'\';}" onblur="if (this.value == \'\') {this.value = \'Кто Ищет, Тот Найдет !\';}" /><input type="submit" class="my-wp-search" id="searchsubmit" value="🔍" /></p></form>';
$items .= '</li>';
}
return $items;
}
add_filter('wp_nav_menu_items','add_search_to_wp_menu',10,2);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question