WordPress.org

Support

Support » Themes and Templates » how to remove sidebar in post but not switch to full text view?

how to remove sidebar in post but not switch to full text view?

  • alexandros_z
    Member

    @alexandros_z

    Hello.
    I would like to remove the sidebar from my posts but at the same time not switch to full text view.
    Is this possible? And how?
    I could do something similar in twenty eleven, where I could display only the text of the post in the center (and not in full text mode) without the sidebar

    Thank you for your time,
    Alex

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    Simplest solution would be to comment out get_sidebar() call in single.php file. To do this you could change the line:

    <?php get_sidebar(); ?>

    to this code

    <?php // get_sidebar(); ?>

    Much better solution, that also preserves your customisations during theme update, would be to substitute the singe.php with new contents using child templates approach.
    Rgds
    Chris

    alexandros_z
    Member

    @alexandros_z

    Thank you very much for your reply.

    I tried that yesterday and worked for me! (with some additional css so I can place it to the center)

    My only concern was if this is too much hacking and I may destroy anything else that now I can’t think about.

    Thank you once again for your time,
    Alex

    Alex,

    If You want to leave your original theme intact and build upon it just use child themes – you can read about it on codex at: http://codex.wordpress.org/Child_Themes

    Regards
    Chris

    Hi,

    how do I remove the 2012 sidebar while keeping a reduced page width?

    meaning the initial page width less the sidebar width.

    Thanks,
    Dave

    paulwpxp
    Font hero

    @paulwp

    For Twentytwelve, page will be full-width by default IF there is NO widget in the sidebar. It’s done automatically without you doing anything to the template.

    In addition, you might take a look at Widget Logic Plugin, so that you can control the appearance of sidebar widgets conditionally.

    Widget Logic
    http://wordpress.org/plugins/widget-logic/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘how to remove sidebar in post but not switch to full text view?’ is closed to new replies.