Removing the Sidebar - Help!!

5 replies
  • WEB DESIGN
  • |
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
#removing #sidebar
  • Profile picture of the author HomeBizNizz
    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.
    {{ DiscussionBoard.errors[1079227].message }}
  • Profile picture of the author moralde
    Depending on the theme, that would probably leave a gaping blank space where the sidebar should have been.
    {{ DiscussionBoard.errors[1079238].message }}
    • Profile picture of the author iBBnet
      Originally Posted by moralde View Post

      Depending on the theme, that would probably leave a gaping blank space where the sidebar should have been.
      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
      Signature
      Bryan
      After5PC.net
      Freelance Web Development
      and Graphic Design Services
      {{ DiscussionBoard.errors[1080675].message }}
  • Profile picture of the author dudeitschris
    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.
    Signature
    SUPER SIMPLE social media strategy to flood your website with traffic and add 500 leads to your list in 30 days.
    {{ DiscussionBoard.errors[1083029].message }}
    • Profile picture of the author Sissy76
      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
      {{ DiscussionBoard.errors[1088154].message }}

Trending Topics