Forums

Page without Sidebar (6 posts)

  1. mattc908
    Member
    Posted 1 year ago #

    The title says it all how would I create a page (not a post) in wordpress to have it so the sidebar would not show up, the iframe im using needs all the space it can get.

  2. Ivovic
    Member
    Posted 1 year ago #

    http://codex.wordpress.org/Conditional_Tags

    check out is_page() on that link... surround the sidebar template tag in your theme's page.php with a conditional like:

    <?php if (!is_page('ID')) get_sidebar(); ?>

    where ID is the page ID number you want to nuke the sidebar on.

    Depending on your theme, you might also want to change the width of your main content div. For most themes that's called 'content' in the same page.php file...

    <?php
    if (is_page('ID')) $contentclass = 'superwide';
    else $contentclass = 'normal';
    ?>
    <div id="content" class="<?php echo $contentclass; ?">

    your milage may vary, but the same idea applies.

  3. mattc908
    Member
    Posted 1 year ago #

    <?php if (!is_page('ID')) get_sidebar(); ?> so that doesnt seem to turn off the sidebar for my page.

  4. Ivovic
    Member
    Posted 1 year ago #

    did you actually read what I wrote? - you have to change the "ID" to the ID number of your page.

  5. mattc908
    Member
    Posted 1 year ago #

    Yes I changed the id to the page ID

  6. Ivovic
    Member
    Posted 1 year ago #

    well I'm not sure why, in that case.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.