The MU forums have moved to WordPress.org

Conditional Tags (3 posts)

  1. carnold
    Member
    Posted 15 years ago #

    I use 1.5.1 and been reading on WP conditional tags but can not find the answer on how to do what i want. What i want to do is when on a certain page, do not display the right sidebar. I have tried to code this on the index.php page and sidebar page using if(is_page(948)) but i don't know how to not show the right sidebar. Can some nice person help me understand conditionals? Here is what i have tried so far:

    <?php
    if (! is_page('948'))
    {
       include(TEMPLATEPATH."/sidebar2.php");
    }
    ?>
  2. andrea_r
    Moderator
    Posted 15 years ago #

    Why not make a special page template just for that post, *without* the sidebar code, and when you edit that post, use that page template?

  3. carnold
    Member
    Posted 15 years ago #

    OK, i got the sidebar to not show when on a certain page but the sidebar space still is maintained. Here is the code i used on the page.php file:

    <?php if (is_page('948'))
    {}
    else {
    include(TEMPLATEPATH."/sidebar2.php");
    }
    ?>

    How can i use the sidebar space in other words, i want my forums to "extend" into the space where the sidebar use to be)?

    *EDIT* I did not see your post andrea_r until after i posted. This page is a "forum" page and is a plugin....Maybe i could not call the sidebar from the forum plugin? *looks into forum code*
    Don't see where the simple:forum plugin calls the sidebar.

About this Topic