Archived topic
Possible to *not* turn nav bar into a button on mobile?
13 replies · Started by Anonymous on July 12, 2015
Dear GeneratePress,
On small screens the nav bar turns into a button/menu.
Is there a way to prevent this theme from doing that?
Thanks so much for your help with this!
Sincerely,
Greg
Hi Greg,
There definitely should be :)
First, add this CSS: https://gist.github.com/generatepress/1442471cf3e3651d1725
Then, add this PHP:
add_action( 'wp_print_scripts', 'generate_dequeue_mobile', 100 );
function generate_dequeue_mobile() {
wp_dequeue_style( 'generate-mobile-style' );
}
Adding CSS: http://generatepress.com/knowledgebase/adding-css/
Adding PHP: http://generatepress.com/knowledgebase/adding-php-functions/
That should do it :)
Has anyone ever told you that your dedication and customer support is first rate?
I haven't tried making these modifications yet, but I trust that if there's an issue I can count on you to help with it.
You've got yourself a new fan and a new customer. :)
Hmm, OK, so I just:
- Purchased the GP Premium add-on and installed it.
- Downloaded and installed the child theme (and activated it).
- Copy/pasted the CSS and PHP into their corresponding areas.
And it doesn't work. :-(
When I shrink the width of the page it still shows the menubar.
I made sure to clear the page cache (I have W3 Total Cache installed) and refreshed the site in both Safari and Firefox and it doesn't work in either. Still shows the nav.
After posting this I'll send you an email with my website's address so you can see for yourself.
Help very much appreciated!
Hmm, can you try this instead?:
add_action( 'wp_enqueue_scripts', 'generate_dequeue_mobile', 100 );
function generate_dequeue_mobile() {
wp_dequeue_style( 'generate-mobile-style' );
}
Hi Tom,
I can't speak for the OP, but I'm trying to make the same change and neither of those solutions are working for me - it still shows the menu button on mobile devices.
Any other tricks up your sleeve? :)
Many thanks,
--Gregor
Ugh, total brain fart.
I edited the code above - it should work now :)
It does indeed work now - thank you very much!
Awesome :)
Awesome, that seems to finally work on my end too!
Thanks so much for your help!
Awesome! :)
Just in case it helps your other users find this post, here are some keywords they might search for:
navbar, navigation, hide, disable
Hey I am trying to acheive the same thing.
Not working for me in 2020.
I added CSS to the customize -> aditional css
Added php using code snippets.
Hi there,
this is a realllllly old post - would you mind starting a new topic where we can help :)