Code for a Blank No Sidebar Page
-
I had been searching for a long time for the correct code for a No Sidebar page WITH FULL SCREEN display. I found some code and modified it adding the header and footer and it’s working perfectly on my site.
====================================
<?php
/**
Template Name: Page with NO Sidebar
*/
get_header(); ?>
<html>
<head><style type=”text/css”>
#page-content { width: 640px; margin: 20px auto; }
#page-content p { font-size: 1em; font-family: Georgia; line-height: 1.5em; text-align: justify; }
</style>
<title><?php wp_title( ‘|’, true, ‘right’ ); bloginfo(‘name’); ?></title>
<?php wp_head(); ?>
</head><body>
<?php while (have_posts()) : the_post(); ?>
<div id=”page-content”>
<?php the_content(); endwhile; ?>
</div>
</body>
</html>
<?php get_footer(); ?>=============================================
Just save the file as “page-nosidebar.php” (without the quotes). Then when you create page, just to Page Attributes and select “Page with NO Sidebar” and you’re all set. Also, you can take an existing page and edit it and select Page with NO Sidebar for the same results.
Place this file in your site’s theme root folder.I hope this may help someone.
- The topic ‘Code for a Blank No Sidebar Page’ is closed to new replies.