WordPress.org

Ready to get started?Download WordPress

Forums

Remove sidebar from pages (2 posts)

  1. indscan
    Member
    Posted 8 years ago #

    i need to remove sidebar from pages. I use journalized sand theme and there is no pages.php

    how should i go about it?

    any suggestions?

  2. brittanie
    Member
    Posted 8 years ago #

    The easiest way would be to put conditional tags around your sidebar saying that it should only show up if you are NOT viewing a page.

    Here is the Codex's list of conditional tags. In your sidebar.php template, you would want to add these tags somewhere near the top, probably right under where it says
    <div id="sidebar">
    <ul>

    but before the actual *content* of the sidebar starts. Then just add the tags for all the pages you want the sidebar to show up on. It will look like this:

    <div id="sidebar">
    <ul>
    <?php if (is_home() | is_single() | is_category()) : ?>
    (or whatever "if" statements you choose)
    ...

    sidebar content

    ...

    then at the bottom of all the sidebar content you'll add

    <?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.