Site logo

Archived topic

how to modify navigation content?

3 replies · Started by verdk on March 3, 2023

Viewing posts 1–4 of 4

Hi,

I use newsroom site template, and want to remove & modify elemnt/content in <nav id="site-navigation" class="main-navigation ..." >.

What is the best way to do it?
I want to remove search bar from the navigation and want to center the menu.

Thank you & Regards

Hi there,

go to Customizer > Layout > Primary Navigation.
Set the Navigation Alignment to Center
And Disable the Navigation Search

Thank you David.

It seems I have reading problem, I've already opened the menu before asking sending this question.

What is the recomended way if I want to modify <nav></nav> structure? add some icons, add other html tag, etc, something that is not accomodate by the customizer menu?

You can use GP Elements:
For example the Block Element Hook:

https://docs.generatepress.com/article/block-element-hook/

Or the regular code Hook:

https://docs.generatepress.com/article/hooks-element-overview/

The theme has many action hooks that are exposed in Elemeents.
Example: generate_menu_bar_items is where the search icon and other icons get hooked into the desktop and mobile navs.
In addition to this there are many other hooks, check the hook list in either element to see them all listed under Navigation.

If theres a specific place you need then let me know

This archived topic is closed to new replies.