- This topic has 9 replies, 3 voices, and was last updated 6 years, 3 months ago by Tom.
-
AuthorPosts
-
January 5, 2018 at 4:40 am #463657Terence
Hi Tom,
The “top bar” seems to be rather unloved, when you compare it with the rest of GP, and plugins which do a similar job. Do you plan to add additional functionality, location or customisation possibilities in the near future?
Also, to use the GP top bar I need to move it to below the primary navigation. Is that easily achieved? I couldn’t find any reference to moving it.
January 5, 2018 at 8:27 am #463886LeoStaffCustomer SupportHi there,
What specific features are you looking for?
Usually top bar stays at the top of the page. What are you trying to add? Maybe we can try Hooks solution.
Let me know π
January 5, 2018 at 12:41 pm #464073TerenceHi Leo,
The two key features I need are A) the ability to relocate the Top Bar below the primary navigation, and B) a way to include a link (to a sign-up/opt-in page), using a prominent and clickable button.
There are several Top Bar opt-in plugins in the repository, but I don’t think it should be necessary to use a plugin for just this, as it would seem to me that all the necessary functions must be there.
Somewhere. π
January 5, 2018 at 6:08 pm #464181LeoStaffCustomer SupportA) What about using the secondary navigation?
B) Secondary navigation can also do that. If not GP hooks should help as well:
https://docs.generatepress.com/article/hooks-overview/People generally want top bar at the top of the page. We haven’t really received any requests from other users on adding extra features in top bar.
If you can show me what you would like to achieve, I might be able to provide better suggestions π
January 6, 2018 at 6:24 am #464412TerenceAs I have explained the type of content I want to use, I clearly don’t want menu in that location.
Can you please explain to me, ideally with a code snippet example, how to use GP hooks to move the top bar specifically, down to below the primary navigation?
January 6, 2018 at 9:35 am #464567LeoStaffCustomer SupportWe wouldn’t use GP hooks to use top bar.
GP hooks allows you to add content throughout the theme.
What if you add the content you want into After Header hook?
http://demo.generatepress.com/hook-locations/It would show up below the navigation.
January 6, 2018 at 6:50 pm #464813TerenceThe problem I see with using the secondary navigation is that I want to change the background colour to denote a change of category so let me take a look at using the after-header hook and see what I can come up with.
January 6, 2018 at 9:01 pm #464861TomLead DeveloperLead DeveloperThe secondary navigation would do that – the menu item would get a current class and change colors if you’re on that page. The top bar wouldn’t achieve that.
The top bar itself likely doesn’t need a location option, as it’s the top bar and is used at the top of the page.
That being said, we can always move things around with a function:
add_action( 'after_setup_theme', 'tu_move_top_bar' ); function tu_move_top_bar() { remove_action( 'generate_before_header', 'generate_top_bar', 5 ); add_action( 'generate_after_header', 'generate_top_bar', 6 ); }
January 8, 2018 at 8:55 am #465947TerenceI am beginning to see the light Tom.
Thank you for that, and even if I don’t use the Top Bar on this occasion, I have at least learned, in principle, how to move things around with a function.
Many thanks,
Terence.
January 8, 2018 at 12:07 pm #466099TomLead DeveloperLead DeveloperNo problem! π
-
AuthorPosts
- You must be logged in to reply to this topic.