Archived topic
search in secondary navigation menu
9 replies · Started by dassana on February 12, 2019
hi
in the home page on desktop, i want to add a search icon in the secondary nav menu. the home page displays the secondary nav menu. i tried adding links in the WordPress menu and using font awesome search icon but the search icon is not clickable. any other way to do this is generatepress or i am doing something wrong. home page link mentioned below.
Hi there,
Sounds like this is what you are looking for:
https://docs.generatepress.com/article/navigation-search/#use-navigation-search-in-secondary-navigation
hi leo
i do not want to remove the search from primary navigation which i am displaying on all pages and posts. i am only displaying secondary navigation on home page. is there a way to include the search in secondary navigation without getting it removed from the primary navigation. or a way to add google search code. i could not reply earlier as i was travelling.
regards
dassana
Would it work if we move the search to secondary nav on the home page only?
i am using the search in primary navigation. so is it possible to have search in both primary as well as secondary navigation.
Unfortunately, that's not possible at this time. The nav search is designed in such a way that it can only exist once on a page.
thanks tom for the reply. then how do i add google search code or the wordpress search code after the secondary menu on the homepage just before the newly updated recipes - https://www.vegrecipesofindia.com/
You could create a new Hook Element: https://docs.generatepress.com/article/hooks-element-overview/
And add it to the generate_inside_secondary_navigation hook.
Then add your code inside a wrapper like this:
<div class="secondary-search">
Your search code
</div>
Then you could add some CSS like this:
.secondary-search {
float: right;
}
thanks a lot tom. will try the code.
No problem :)