Removing the Sidebar - Help!!

by 5 replies
7
Hello wise design warriors,

I've created a wp theme using Artisteer and want to remove the sidebar from one page, but keep it on the others.

I've done a good old google search and have found a solution using
< ? php get_sidebar(); ? > in the page.php file, and adding the following around it:

<?php if (is_page('x')) : ?>
<?php else : ?>
<?php get_sidebar(); ?>
<?php endif; ?>

however, my theme's sidebar code looks like this:

</div>
<div class="sidebar1">
<?php include (TEMPLATEPATH . '/sidebar1.php'); ?>
</div>

and I have no idea how to apply the <?php get_sidebar(); ?> solution above to it, or if I should even bother trying to, is there another solution for my code?

Can anyone help?

Cheers,
Sissy
#website design #removing #sidebar
  • Cut away this:
    <div class="sidebar1">
    <?php include (TEMPLATEPATH . '/sidebar1.php'); ?>
    </div>

    The sidebar will not be included even if the file exists.
    Should do the trick.
    • [ 1 ] Thanks
  • Depending on the theme, that would probably leave a gaping blank space where the sidebar should have been.
    • [ 1 ] Thanks
    • [1] reply
    • That's true. Keep that in mind, as you will definitely have a blank space where that sidebar would have been.

      Maybe you can create a css style to accommodate that change
      • [ 1 ] Thanks
  • You can also just try commenting out the code so you don't mess it up in the event you don't get the desired result. Just place a <!-- before the code and --> after the code. It will hide that entire section.
    • [ 1 ] Thanks
    • [1] reply
    • Thanks so much guys for your replies.
      I actually managed to created a single page theme, uploaded it to my cpanel & voila - it worked! Feeling very chuffed with myself !
      Didn't know about the hide command, will give that a go next time.

      Cheers again,
      Sissy

Next Topics on Trending Feed