I want to hide the navigation menu on a particular page. I know how to find the page id, but I am clueless about how to find the rest of the stuff, it would be great if someone could look into my blog's css from the link - idkwhereto
Thanks.
I want to hide the navigation menu on a particular page. I know how to find the page id, but I am clueless about how to find the rest of the stuff, it would be great if someone could look into my blog's css from the link - idkwhereto.com
Thanks.
add_action("wp_footer","Stack_308520_hide_menu");
function Stack_308520_hide_menu(){
if(is_page(889 /*your page id*/){
?>
<style> nav.width-navigation {display:none}</style>
<?php
}
}
this is a pure css solution
If your theme uses body_class
function in header.php
, then you don't need to do anything in code...
Just add this code as Additional CSS in Customizer (Appearance -> Customize)
body.page-id-2 nav.width-navigation {display:none}
/* where 2 is the ID of your page */
But remember - it will only hide the navigation - it still will be in HTML code...
body_class()
in header.php? – Krzysiek Dróżdż Commented Jul 14, 2018 at 9:38