Site logo

Archived topic

Search Block Element not in collapsed hamburger menu but outside

5 replies · Started by Björn on October 1, 2022

Viewing posts 1–6 of 6

Hi.

I've created a block element for a search functionality and hooked it to "after_primary_menu". On desktop it shows as intented after the menu items in the nav bar.

On mobile it shows outside the collapsed hamburger menu but I'd like to have it inside it. When the user expands the mobile hamburger menu the search should appear.

Have tried all available hooks - not the desired result.

Hi Bjorn,

Try this CSS:

.main-navigation.toggled form.wp-block-search.hide-on-mobile {
    display: block !important;
     width: 100%; 
}

No change at all.

I still have it on "after_primary_menu" - shall I keep this?

You have thehide-on-mobileclass on the search block before, did you remove it?

If so, the CSS won't work. Can you add it back?

Wow, that's exactly how I wanted it.

A big THANK YOU to you!

You are welcome :)

This archived topic is closed to new replies.