Archived topic
Secondary navigation on mobile question
39 replies · Started by Anonymous on July 10, 2015
Ah, you want it on all blog pages.
Well maybe it would be easier to just remove it on pages?
add_action('after_setup_theme', 'remove_nav_exclude_blog_page');
function remove_nav_exclude_blog_page() {
if ( is_page() )
remove_action('generate_after_header', 'generate_add_secondary_navigation_before_header');
}
Thank you Tom, your solution adding PHP and CSS worked a treat for me. Handy for when using Secondary Nav for contact details.
- Jono
Awesome, glad to hear it works :)
Hey Tom,
Marvellous how to fix this. I was looking for this solution as well. I added the code in the simple php plugin and then the css. It did exactly what i want, but gave one tiny issue, and that is that a dropdown in the menu is suddenly pushed to the right of the menu, so out of the screen. If i remove the code again it goes nicely down as is default.
Take a look if you want on test.primemedia.nl
Hi there,
Give this CSS a try:
@media (max-width: 768px) {
.widget-area .secondary-navigation ul ul {
position: relative;
clear: both;
left: 0;
width: 100%;
}
}
Worked perfectly sir. Thanks alot:)
No problem! :)
Hi Tom,
Thanks for the easy theme! Hope you can help me:)
I want to keep my secondary nav open on mobile, without the toggle option. So that it just shows my social icons next to each other inline.
I tried the php and css code, but it looks like it doesn't work. It hides my whole second menu.
See my website here: https://goo.gl/aL5Ott
Thanks!
Hi Dominik,
Is this the code you tried? https://generatepress.com/forums/topic/secondary-navigation-on-mobile-question/#post-120014
I just tested and it's working for me
Make sure you click "Save Changes and Activate" in Code Snippet.
Let me know.
Hi Leo,
Thanks for you quick reply and solution.
It works! I didn't click the activate button.
Thanks!
You're welcome :)
After adding the CSS via Customizer and then the PHP using both Code Snippets and as an individual plugin, I am still not getting any change with the secondary nav. Am I missing something???
Please help.
Try just using Code Snippets and make sure the snippet is activated.
Also make sure to clear cache if you are using a caching plugin.
If this still doesn't work can you provide a link to your site?
Only using Code Snippets.
Cache has been cleared.
Here's the site: http://towtruck.wpengine.com/
Thanks for your help in advance.
I don't see the secondary menu toggle button which means the CSS is working which is good.
Tried the PHP here and it worked for me so just want to make sure this is what you added: https://generatepress.com/forums/topic/secondary-navigation-on-mobile-question/#post-120014
Also make sure you click Save Changes and Activate in the snippet.