WordPress.org

Ready to get started?Download WordPress

Forums

How to get rid of the sidebar on the posts page? (9 posts)

  1. Drain0
    Member
    Posted 3 years ago #

    I would like to get rid of the sidebar on the posts page but even though I have chosen "one column, no sidebar" it still shows

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Are you currently using a static front page on your site?

  3. Drain0
    Member
    Posted 3 years ago #

    Yes

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    Your main posts page will automatically use your theme's index.php template file - not any page template that you try to apply.

  5. Drain0
    Member
    Posted 3 years ago #

    Thanks Esmi, do you know if there is a hack or fix to allow no sidebar on posts page?

  6. esmi
    Forum Moderator
    Posted 3 years ago #

    You would need to modify your theme's index.php template file. But don't edit the Twenty Ten theme. Your changes will be over-written the next time you upgrade WordPress or the theme. For this reason, it is recommended that you consider creating a child theme for your customisations.

  7. Drain0
    Member
    Posted 3 years ago #

    Thanks Esmi editing out <?php get_sidebar(); ?> index.php and single.php gets rid of sidebar.
    #content is still the same width so I made it width: 90% margin: 0 auto but unfortunately this runs under the sidebar on other pages.

    Thanks anyway.

    BTW: I am doing a child theme. The theme I'm using is Third-Style.

  8. alchymyth
    Forum Moderator
    Posted 3 years ago #

    i don't have a local copy of 'third style' to check it, but if 'third style' is an offspring of twenty ten, then try to change the following line in index.php:

    <div id="container">

    to:

    <div id="container" class="one-column">

    (this is from the one column template; if the above is not exactly right, have a look into the one column template of your theme)

  9. Drain0
    Member
    Posted 3 years ago #

    Thank you alchymyth that fixed it.

    To recap - This is how to remove sidebar from posts pages:

    Delete <?php get_sidebar(); ?> and change <div id="container"> to <div id="container" class="one-column"> in index.php and single.php

Topic Closed

This topic has been closed to new replies.

About this Topic