Forums

Remove sidebar everywhere but home page (5 posts)

  1. toobroketofix
    Member
    Posted 3 years ago #

    I want to keep the sidebar on main page but remove it from everywhere else, and in addition, make the width for these other pages the full width. I'm using a custom theme, MistyLook 3.6.1, but the author says it's too complicated as it will require changing multiple files.

    Anyone got a clue?

  2. Roy
    Member
    Posted 3 years ago #

    You can make different sidebars, but your request requires removing the get-sidebar argument from all php files instead of the index.php and in order to use the space that comes free, you'll need to edit the style.css thus that you have a part for the index and a part for the rest. Undoubtly this is possible, but I'm not the person to help you with coding.

  3. toobroketofix
    Member
    Posted 3 years ago #

    Thanks Gangleri,

    This points me in the right, albeit hair-tearing, direction.

  4. bizarrerie
    Member
    Posted 3 years ago #

    You could simply create a home.php template file. This is the file wordpress searches for first, as explained in the codex. Simply code a sidebar in home.php, and then manually delete the sidebar in all other templates (page.php, index.php, tag.php, etc...) and then style it to your liking.

    Hope this helps.

  5. motti_b
    Member
    Posted 3 years ago #

    To make your side bar disappear on a single post edit your sidebar code like so:

    At the very top of your sidebar file paste:

    <?php if(is_single()){}else{ ?> (that should be the first line of code)

    At the very end of your sidebar file paste:

    <?php } ?>
    (that should be the last line of code)
    That should make your sidebar disappear when viewing a single post.

Topic Closed

This topic has been closed to new replies.

About this Topic