Add a Page without header and menus?

The question:

Is it possible to add a Page in WordPress, so that none of the header or the menus of the site appears on that page?

And also so that the stuff in sidebars that’s on the rest of the site doesn’t appear. And the stuff at the bottom of the page (there’s a ‘Leave a reply’ form on the other pages.)

So on this site: http://richardclunan.com/ don’t want any of the header handwriting or the ‘hey there’ / ‘portfolio’ / ‘need copywriting’ / ‘etc’ menu items to appear on one particular page, nor the side-bar sign-up box, nor the ‘leave a reply’ form. But I want all that stuff to appear on all other pages.

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

Create a custom Page Template, leave out the get_header(), get_footer(), and get_sidebar() calls in it, and put in your own html header/footer code in the Page template instead.

http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

Method 2

Rich – If you create an HTML page (however you wish) called something.html, and drop it in the same folder as the wordpress install, then http://richardclunan.com/something.html will show that page.

I had a blog made of static pages before flipping to WP. The old pages appear fine if fould on old bookmarks or search engines. http://joetaxpayer.com/gold is an example, get rid of the ending /gold and you see the WP site is there.

Method 3

you can create a new page template and associate it with that page.

on the page template, don’t include the sidebar ( <?php get_sidebar(); ?>) and don’t allow comments on that specific page, either by removing the call to the comment template, usually comments_template() or using the wp page admin.

the header and navigation is a bit more complicated but easily done by wrapping them in a conditional if( get_the_id() != '99' ) { ... } . Replace 99 with your page id surely.

Method 4

How to remove page elements by CSS

Open the inspector, and try to find the class or the id of the elements that you want to hide:

Add a Page without header and menus?

Then customize your CSS with :

body.page-id-2 h1.title {display:none;}

This way, you only hide the elements, not eliminate them. So that you don’t break any potential function that requires to have the elements, e.g. page layout or scripts in footer.

Source: https://thethemefoundry.com/tutorials/hiding-parts-of-your-theme-with-displaynone/


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment