- This topic has 39 replies, 9 voices, and was last updated 7 years, 8 months ago by
Leo.
-
AuthorPosts
-
July 10, 2015 at 4:43 am #119954
Sharon
Hi, I want to have two links across the top of my website even on mobile, so I was thinking the Secondary Navigation addon would be useful but only if I can stop it going into mobile-mode on mobiles. Is there a way to do that? Love this theme so much!
July 10, 2015 at 9:49 am #120014Tom
Lead DeveloperLead DeveloperHi Sharon,
First, add this function:
add_action( 'wp_enqueue_scripts', 'generate_dequeue_secondary_nav_mobile', 999 ); function generate_dequeue_secondary_nav_mobile() { wp_dequeue_style( 'generate-secondary-nav-mobile' ); }
Adding PHP: http://generatepress.com/knowledgebase/adding-php-functions/
Then, add this CSS:
.secondary-navigation .menu-toggle { display: none; }
Adding CSS: http://generatepress.com/knowledgebase/adding-css/
Let me know if that works or not 🙂
July 10, 2015 at 12:49 pm #120070Sharon
Thanks so much for the fast reply. I’ll let you know, am on my phone atm.
December 15, 2015 at 9:20 am #160181Rachel
I am not comfortable editing the code. The theme should be mobile =
friendly without the need for that, please advise.Rachel
December 15, 2015 at 9:55 am #160189Tom
Lead DeveloperLead DeveloperHi Rachel,
The theme is mobile friendly, the question here is how to make the secondary navigation not mobile friendly.
December 15, 2015 at 10:02 am #160191Rachel
To have both nav bars say menu doesn’t look right.
December 15, 2015 at 10:02 am #160192Rachel
culinarytwisted.com
take a look on a mobile device
December 15, 2015 at 10:04 am #160193Tom
Lead DeveloperLead DeveloperYou can change the “Menu” text to whatever you like in “Customize > Secondary Navigation”.
You can also change the primary menu text if you have Menu Plus.
December 15, 2015 at 10:07 am #160194Rachel
For mobile?
December 15, 2015 at 10:11 am #160195Tom
Lead DeveloperLead DeveloperAbsolutely. Go to “Customize > Secondary Navigation > Secondary Navigation > Mobile Label”.
December 15, 2015 at 10:25 am #160203Rachel
What does it mean by “sticky menu”?
December 15, 2015 at 3:32 pm #160305Tom
Lead DeveloperLead DeveloperThat means the menu will stick to the top of your browser once you scroll past it.
July 23, 2016 at 2:42 pm #212352Jessica
This worked like a CHARM!!!! Thank you for posting.
Now I am trying to solve this: Conditionally Remove Secondary Nav Menu from all pages EXCEPT the blog.
I am this far but it’s breaking my site:
add_action('template_redirect', 'remove_nav_exclude_blog_page'); function remove_nav_exclude_blog_page() { if ( !is_page('blog') ) remove_action('generate_after_header', 'generate_add_secondary_navigation_before_header',); }
I have already successfully repositioned the secondary nav into place… just don’t want it showing anywhere except the blog. What am I mucking up?
July 23, 2016 at 6:04 pm #212408Tom
Lead DeveloperLead DeveloperIt might be easier to use CSS:
.secondary-navigation { display: none; } .blog .secondary-navigation { display: block; }
Otherwise, something like this might work better:
add_action('after_setup_theme', 'remove_nav_exclude_blog_page'); function remove_nav_exclude_blog_page() { if ( ! is_home() ) remove_action('generate_after_header', 'generate_add_secondary_navigation_before_header'); }
July 23, 2016 at 7:18 pm #212412Jessica
The function definitely works but it only removes the secondary nav from the homepage.
When I tried the CSS method it definitely worked but won’t show the secondary nav on anything BUT the main blog landing page. The individual posts hide it.
I feel like there’s still another missing piece. Essentially: having the secondary nav show on all blog pages, not just one archive page. I’m digging to find the additional classes for the category archives & individual post archives but I feel like there’s another way to do this with a single function, no?
-
AuthorPosts
- You must be logged in to reply to this topic.