Support » Themes and Templates » How to get rid of the sidebar on the posts page?

  • 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

Viewing 8 replies - 1 through 8 (of 8 total)
  • esmi

    (@esmi)

    Forum Moderator

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

    Yes

    esmi

    (@esmi)

    Forum Moderator

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

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

    esmi

    (@esmi)

    Forum Moderator

    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.

    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.

    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)

    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

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to get rid of the sidebar on the posts page?’ is closed to new replies.