Support

Home Forums Event Espresso Premium How do I remove menu bar (and header maybe) from single page?

How do I remove menu bar (and header maybe) from single page?

Posted: June 22, 2017 at 2:32 pm

Viewing 1 reply thread


afamilyedu

June 22, 2017 at 2:32 pm

I’m using WordPress, Event Espresso, Iced Mocha Theme. I’ve got a new template written and loaded that works where I could change the code. What can I change for the menu (and it would be ok if the whole header was gone.. but when I tried that, but then the styling was off). It looks like this right now:

<?php
/**

Template Name: HeadLess

A custom page template without a header or sidebar.

The "Template Name:" bit above allows this to be selectable

from a dropdown menu on the edit page screen.

@Package Iced Mocha

@subpackage iced_mocha

@SInCE iced_mocha 0.5
*/
get_header(); ?>

 <section id="container" class="one-column">

 	<div id="content" role="main">
 		<?php espresso_theme_before_content_hook(); ?>

 		<?php get_template_part( 'content/content', 'page'); ?>

 	</div><!-- #content -->
 	
 </section><!-- #container -->


Josh

  • Support Staff

June 22, 2017 at 3:44 pm

Hi there,

You can actually make a copy of the header.php file, then rename that copy to be header-headless.php. Then you remove the following code from your copy:

<div id="header-full">
	<header id="header">
<?php espresso_theme_masthead_hook(); ?>
		<div id="masthead">
			<div id="branding" role="banner" >
				<?php espresso_theme_branding_hook();?>
				<?php espresso_theme_header_widgets_hook(); ?>
				<div style="clear:both;"></div>
			</div><!-- #branding -->
			<a id="nav-toggle"><span>&nbsp;</span></a>
			<nav id="access" role="navigation">
				<?php espresso_theme_access_hook();?>
			</nav><!-- #access -->
		</div><!-- #masthead -->
	</header><!-- #header -->
</div><!-- #header-full -->

Then, in the page template that you have already, you change this:
get_header(); ?>
to be this:
get_header( 'headless' ); ?>

Please be sure to set up a child theme if you haven’t done so, your custom templates are best put into a child theme.

https://codex.wordpress.org/Child_Themes

Viewing 1 reply thread

The support post ‘How do I remove menu bar (and header maybe) from single page?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso