Need to hide menu completely on some pages


Author Message
Toolie Garner

Posted: 10/20/2014
Quote message 

I created a Wordpress theme using Artisteer v4.3 Home & Academic, and I would like to hide the menu on some of the pages so that I can set a headline and content the way I want. I know I can hide the header and sidebars, and I know I can exclude the page from the menu, but I want to hide the MENU itself from the page. Can this be done?
 
calsnoboarder

Posted: 10/20/2014
Quote message 

I will assume you know what page templates are... that's your answer... using artisteer to create your theme, then create the same theme without a menu, then upload the first theme (with the menu) as your base theme in wordpress... then you open up the second theme zip, copy a few files (to use as a new page template), then upload the files as needed...

If done correctly, your page/post admin will have a templates field where you can choose the template for that page... choose the template without a menu and voila... you have pages without menus (though it does cause a bit of a problem for site visitors who want to navigate to other parts of your site... imagine their chagrin when they've entered a room without an exit! The horror!
 
calsnoboarder

Posted: 10/20/2014
Quote message 

Oh.. forgot.. in case you don't know what page templates are...

http://codex.wordpress.org/Page_Templates
 
or

Posted: 10/21/2014
Quote message 

Or you could try adding a bit of conditional logic to your header.php file between the head tags - something like:

<?php if ( is_page(array('2077', '539')) ) { ?>
<style>
.art-nav{display:none;}
</style>
<?php } else { ?><?php } ?>

The menu is normally wrapped in a div like .art-nav but use firebug etc to identify the correct div name. Substitute the page numbers for the pages you wish to hide the menu on, obviously.

Or... following the idea of templates, you could copy your page.php file and add this BEFORE the first <?php at the very start of the file:
<?php
/*
Template Name: nomenu
*/
?>

<style>
.art-nav{display:none;}
</style>

Then save it as nomenu.php and upload it to your theme's folder.
Then any page you don't want a menu, just select your template from the dropdown options :)
 
gcm

Posted: 10/21/2014
Quote message 

Go to Pages. Select/Edit the page you do not want the menu to appear in. Go to Custom Fields and add style (<style> .art-nav{display:none;} </style>) as OR suggest in his answer. See images below on how to do this.

If Custom Fields does not appear, in upper right hand side select "Screen Options" and put a checkmark in "Custom Fields"



1



2



3


 
james baldiga

Posted: 4/27/2017
Quote message 

This is great! thank you for the tip.