Make a Wordpress template page with no sidebar
Here is a quick video tutorial on how to make a new page template for your Wordpress Website. This is kind of advanced stuff so if this is your first time in making a page template, please practice on a test blog or somthing that is not too valuable. This template code will not work with all Wordpress themes, however I have used it on more than 10.. You might have to change the code a bit to get it to work…
Here is the PHP code that I used to make this page template:
<?php
/*
Template Name: Nosidebar
*/
?>
<?php get_header(); ?>
<div id=”content”>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id=”post-<?php the_ID(); ?>”>
<div>
<h1><?php the_title(); ?></h1>
</div>
<div>
<?php the_content(‘<p>Read the rest of this page »</p>’); ?>
<?php wp_link_pages(array(‘before’ => ‘<p><strong>Pages:</strong> ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
</div>
</div>
<?php endwhile; endif; ?>
<div>
<?php edit_post_link(‘Edit this entry.’, ‘<p>’, ‘</p>’); ?>
</div>
</div>
<?php get_footer(); ?>
I made this in a notepad and saved it as nosidebar.php






[...] http://wordpress-websitebuilder.com/m…; Make a WordPress template page with no sidebar. Create a new page template without a side bar or even a footer. Create different templates for your WordPress Website. [...]
Thanks, worked great fast and easy, it took longer to watch the video and got it right in one try.
LOL…yeah I am sorry it took so long…but I try not to leave anything out… Glad it worked for you.
I tried this and all I kept getting was just a blank page with no content.
Does the work for all themes in wordpress?
monty´s last blog ..Thinking The Right Way
All themes are different, however this code fits into many of them. If it doesn’t work you can try editing the code a bit…Look at the page.php to get an idea of how the code is structured.
omg! i have no clue.. will someone tell me how to get this page saved inside my ipod so i can show my little sister?
Maybe you could just send her the url of the page. (the address)
Hey guys…the default Wordpress theme now has this option….so when you are making a post you can choose a template without a sidebar…how great is that. I also notice a lot more themes doing the same thing…Soon this will be the minimum standard or basis included in a bare Wordpress theme.
Hi Mitz,
I don’t see that option in the latest WP install. I’m using Whitehouse as well (just updated earlier this week).
When I try your page template video I’m getting a return page that’s entirely blank.
I do see the name nosidebar in the templates selection box.
I’m using Firefox on the most current WP as well. Site is hosted on my server.
Thanks!
Hi Jerry
have you got the same free theme as me? There may be a pro version. If you do have the same, please try from the start again step by step…Please let me know how you go.