-
gandalf12
Hi,
I have created a block element with element type site header and added Header 1 from the pattern library.
I want to add a search bar and social media icons to the right hand end of the menu items.
I created a new Hook element with the social media icons in it and hook name menu-bar-items, but it does not appear and I could not get it to appear using any of the other hook names in navigation.
I guesss I am approaching this in the wrong way and would like some guidance please, also on how to add the search box.
Thanks
-
Hi there,
You can add the social icon to the site header element directly instead of creating a new hook element, as the
menu_bar_itemshook does not exist in the custom site header.If so, you can create a button in the site header element and fill the custom attribute as the doc introduced:
https://docs.generatepress.com/article/navigation-search-modal/#add-custom-navigation-search-modal-triggerJust make sure the Navigation search modal is enabled at customizer > layout > navigation.
-
gandalf12
Hi Ying,
I have added the search and social icons using buttons, but I cannot find where to add the custom attribute, the only one I could find was HTML Attribute.
Can you advise please
Thanks
-
Yes, the HTML attribute in the advanced panel of GB blocks.
https://learn.generatepress.com/blocks/block-guide/getting-started-generateblocks/generateblocks-pro/html-attributes-builder/ -
gandalf12
I tried that by adding data-gpmodal-trigger= in the Name box and “gp-search” in the value but it did not work.
-
Add
data-gpmodal-triggerwithout the=.And did you enable the search modal in the customizer?
-
gandalf12
Hi Ying,
Once again many thanks, it was the = that was stopping it from working, all good now.
Thanks
Richard
-
You are welcome 🙂
- You must be logged in to reply to this topic.