-
andriansah
Hi Teams
I know there is search modal icon on primary navigation, but my client want search box on the navigation on the right side.
How can I do that?
Thanks
-
Hi there,
use a GP Block Element:
https://docs.generatepress.com/article/block-element-hook/
1. go to Appearance > Elements -> Add New –> Block.
2. in the element settings sidebar set the Hook tomenu_bar_items
3. set the Display Rules Location toEntire Site
4. in the block editor add a Search block. -
andriansah
Thank you, it works!
-
Glad to hear that
-
andriansah
Hi, I just notice the size of search widget is too high, just not look ok, How can i customize the size of search block?
Thank you
-
Try this CSS:
.wp-block-search__inside-wrapper :is(input, button) { padding: 8px 8px; margin-inline: 0; } .wp-block-search__inside-wrapper { padding: 0; margin-block: 8px; }
And optionally this CSS will make the search bar fill its own row below the hamburger menu on smaller devices:
@media(max-width: 420px) { .menu-bar-items, .wp-block-search { flex: 1 0 100%; } }
-
andriansah
Thank you, now it’s nicer.
-
Glad to hear that!
- You must be logged in to reply to this topic.