Okay, I’m a little new to all of this but here’s what I did. It’s a little scary but it seemed to work.
I’m guessing you probably know your way around things a bit but I’ll explain it step by step in case someone else needs it. I certainly could have used it!
Basically what I did was move the
<?php get_sidebar() ?>
line from the header.php file to the index.php and page.php files.
1. First duplicate page.php and add this code to the very top:
<?php
/*
Template Name: no sidebar page
*/
?>
You can put anything you want for the “no sidebar page” part but I thought that was easiest and save it as “no sidebar page.php” (or whatever) and upload this to your ftp in your P2 theme folder.
2. Next, in header.php, delete the last line:
<?php get_sidebar() ?>
So the bottom now looks something like this:
<?php endif; ?>
<a class="secondary" href="<?php bloginfo( 'url' ); ?>/"></a>
</div>
</div>
<div id="wrapper">
3. Then add the line you deleted:
<?php get_sidebar() ?>
…to both index.php and page.php, just beneath the line:
<?php get_header() ?>
So the top now looks something like this in the index.php file:
<?php get_header() ?>
<?php get_sidebar() ?>
<div class="sleeve_main">
<?php if ( p2_user_can_post() && !is_archive() ) : ?>
<?php locate_template( array( 'post-form.php' ), true ) ?>
And like this in the page.php file:
<?php get_header() ?>
<?php get_sidebar() ?>
<div class="sleeve_main">
<div id="main">
<h2><?php the_title(); ?></h2>
4. Then go to the page you want to change to not having any sidebars.
Under page attributes you will now see a drop down menu that says “Template”. Just select your new “no sidebar page” template and there you go.
Like I said, no offense is meant if I’ve oversimplified things but maybe someone else can use it. ??
I hope this helps!
Best wishes,
Kristen