I am trying to hide the entire site navigation (logo and menu) for pages and posts on mobile.
https://idealcrm.app/
Current settings
- Mobile Menu – off
- Use Navigation as Header – not checked
I tried all of these in Additional CSS and none work
@media(max-width: 768px) {
body.single #mobile-header {
display:none !important;
}
body.page #mobile-header {
display:none !important;
}
}
@media(max-width: 768px) {
body.single nav#main-navigation {
display:none !important;
}
body.page nav#main-navigation {
display:none !important;
}
}
@media(max-width: 768px) {
body.single #site-nav {
display:none !important;
}
body.page #site-nav {
display:none !important;
}
}
I’ve tried this function in functions.php and it doesn’t work
add_action( ‘wp’, function() {
$disable_nav = get_post_meta( get_the_ID(), ‘_generate-disable-nav’, true );
if ( $disable_nav ) {
remove_action( ‘generate_after_header’, ‘generate_menu_plus_mobile_header’, 5 );
}
}, 100 );