Forum Replies Created
-
AuthorPosts
-
Hey Ismael,
Yea, we eventually removed the search bar.
Thank you.Hi Basilis, I don’t need to change the plugin, but the enfold code I got from this forum.
The Enfold search form needs to be under the Enfold mobile menu. No need to edit the AMP version
Hey Victoria,
That’s how it looks on the AMP version. On the Enfold version, the search bar is above the menu, and I need to drag it down under it.Hi Victoria, that code is awesome. It really helped.
Still, the search is still above the menu links. Any way I can make the search to be the last item in the menu?
I use this code for the search bar:
// Add search bar in menu
add_filter( ‘wp_nav_menu_items’, ‘avf_add_search’, 9999, 2 );
function avf_add_search( $items, $args ) {
if ($args->theme_location == ‘avia’)
{
$search = ‘<li id=”menu-item-search-mobile” class=”menu-item”>‘;
$items = $search . $items;
}
return $items;
}
add_action(‘wp_footer’, ‘avf_add_search_script’);
function avf_add_search_script(){
?>
<script type=”text/javascript”>
(function($) {
$(‘.av-burger-menu-main’).on(‘click’, function() {
var page = window.location.href;
var mobile = $(‘.menu-item-search-mobile’);
var search = ‘<form action=”‘+page+'” method=”get” class=””><div><input type=”submit” value=”” id=”searchsubmit” class=”button avia-font-entypo-fontello”><input type=”text” id=”s” name=”s” value=”” placeholder=”Search”></div></form>’;setTimeout(function() {
if(mobile.find(‘form’).length == 1) return;
mobile.html(search);
}, 500);
});
})(jQuery);
</script>
<?php
}Hi Vinay,
Thank you for your answer.
Btw, I’m starting to observe that my css changes that I do in the Child theme no longer work.
I’ll add the css code in the child, delete every cache I can find and I still won’t see any changes.
Is it that caused by css merging?
Hi Guys,
Sorry for the late answer. This project was put on hold a little while
In order to better understand what I’m talking about please go to this article:
and the AMP version:
https://elitaromaniei.ro/crema-sportului-romanesc-in-2018/?ampIn mobile view, look at the search bars inside the menus.
I have uploaded a side by side print screen here: https://ibb.co/n26DR7I want to make the right side look the same as the left one.
Cheers
Thank you Ismael. :D
That code works. Yet, is there any way to add the search bar after the menu links?
And hide the search icon near the x once the burger opens?
-
AuthorPosts