Site logo

Archived topic

Separate AJAX search from main menu on mobile view

5 replies · Started by trung on May 7, 2020

Viewing posts 1–6 of 6

Hi GeneratePress.
I am designing this website. I use AJAX Search for Woocommerce plugin and add it to main navigation. It works well.
On the mobile view, I want to separate AJAX Search from main navigation (as Cart icon or Search icon).
Please support me. Hope to receive your response.

Hi there,

Create a second Hook Element for your Ajax search Shortcode and this time use the inside_mobile_header hook.

Let us know if you need help with CSS to position it.

Hi David.

I use hook inside_mobile_header that you suggest. It works well. But now, on mobile view, I have a Ajax search above main navigaiton, and other Ajax search on main navigation (click on hamburger menu, the Ajax search is the last item). I think I need your support to do more 2 things:
1. Move the Ajax search downward, below mobile main navigation.
2. Hide/remove the Ajax search item on the mobile main navigation.

Thank you.

Try this CSS:

@media(max-width: 768px) {
    .main-navigation.toggled .main-nav li .dgwt-wcas-search-wrapp {
        display: none;
    }
    .dgwt-wcas-search-wrapp {
        order: 5;
    }
}

It works perfect. Thank you, David.

You're welcome

This archived topic is closed to new replies.