- This topic has 7 replies, 3 voices, and was last updated 4 years, 7 months ago by
David.
-
AuthorPosts
-
August 23, 2021 at 8:50 am #1905628
Gary
Hi GeneratePress,
We want to be able to add a user icon that has a custom URL. However, we’d like it on the left of the search icon and to remain in view on mobile too.
Any ideas?
Thanks.
August 23, 2021 at 9:16 am #1905652David
StaffCustomer SupportHi there,
use a Block Element, to add a GB Button Block with your icon and link.
And select themenu_bar_itemshook from the list.https://docs.generatepress.com/article/block-element-overview/
That will display to the side of the search icon on all devices.
August 24, 2021 at 7:18 am #1906677Gary
Thanks David, that’s sorted it.
August 24, 2021 at 11:34 am #1907146David
StaffCustomer SupportGlad to hear that!
August 24, 2021 at 8:11 pm #1907444Allan
I came across this thread. I finally figured out how to “turn off” an a social icon element part of generate press. It was appearing in my main-navigation block. It has a hook to main_menu_items. I used “inspect” but can’t figure out how that hook got attached to the main-navigation. I want to put it in the Top Bar instead of my main-navigation but don’t see anything to hook to in the top bar. Is it not possible? Or I just don’t know how to do it?
I’d like to know how the main_menu_items hook works. Is it in the theme files? And if so, I can use my child theme to move it to the top bar once I understand that.
Thanks!
August 25, 2021 at 6:02 am #1907869David
StaffCustomer SupportHi Lauren,
hooks are baked in to the various templates, template parts and functions of the Theme. So you don’t move the ‘hook’ instead you need to find a hook that is relevant to the position you require. Unfortunately there is none in the themes Top Bar as its purely a Widget Area that gets called in the header.php – see here:
Whereas the menu_bar_items hook exists within a function that is called in the Primary Nav and Mobile Header:
So for your Top Bar – options:
a) us the Customizer > Widgets > Top Bar, to add a widget for the social icons.
b) don’t use the Themes Top Bar, build your own Top Bar using a Block Element ( or Hook element if you like HTML/PHP ) and Hook it into thebefore_headerhookAugust 25, 2021 at 10:06 am #1908321Allan
Yup, I actually did add social icons myself in top bar. I saw the social icon widget in the Aroma theme and really liked how it was put together, but wanted to put it up top. So I just used the lightweight social icon plugin and put it in the top bar.
Oddly, I originally put it in a block, but when I tried adding the social icons, they didn’t show up. I had to remove the outer block. I’m not sure why that happened. Or maybe user error.
Hooks are new to me – so I was playing around with them – I couldn’t initially figure out how those social icons were appearing in my nav menu but I got it.
August 25, 2021 at 1:27 pm #1908459David
StaffCustomer SupportGlad to hear you found a solution!!
-
AuthorPosts
- You must be logged in to reply to this topic.