Support » Theme: Nuntius » I need to remove the sidebar

Viewing 9 replies - 1 through 9 (of 9 total)
  • Have you created a child theme for your changes?

    No. Just edited it.

    Never edit the theme itself. You will lose all of changes when you next update it. Revert your changes and create a child theme instead.

    Moderator Kathryn

    (@zoonini)

    Automattic Happiness Engineer

    Did you still need any help with this? Looks like you managed to remove the sidebar. Are you good to go?

    Yes. This has been solved.

    Thanks
    Prasun

    Hey. I was contacted privately with this question. I thought I’d post the solution here as email and code snippets don’t mix, but mainly in case other people are also searching for this answer in the future.

    As has been mentioned, the first step is to create a child theme. More information about creating a child theme can be found here:
    http://codex.wordpress.org/Child_Themes.

    In addition to style.css, you’ll need to upload two other, blank files to your child theme’s directory named functions.php and sidebar.php.

    The sidebar.php file should remain blank. This will override the content of the parent theme’s file, and ensure that nothing appears in the right-hand sidebar.

    In the functions.php file, include the following:

    <?php
    add_action( 'widgets_init', 'nutius_child_unregister_sidebar', 11 );
    
    function nutius_child_unregister_sidebar() {
        // remove the right-hand sidebar.
        unregister_sidebar( 'sidebar-1' );
    }
    ?>

    The above code will remove the sidebar area from the Appearance->Widgets page altogether. If you included widgets in this area that you wish to keep after the sidebar has been removed, please remember to move or save their details before implementing the above code.

    Your style.css file should include the following:

    /*
     Theme Name:     Nuntius Child
     Description:    Nuntius Child Theme
     Template:       nuntius
    */
    
    @import url("../nuntius/style.css");
    
    #content {
    width: 100%;
    }
    
    .hentry {
    width: 940px;
    }

    The above snippets will increase the width of the theme’s main content so that it expands over the blank space previously filled by the sidebar.

    Hope this helps! Let me know if there’s anything I’ve missed or overlooked. 🙂

    Moderator Kathryn

    (@zoonini)

    Automattic Happiness Engineer

    Siobhan – that’s excellent, thanks for sharing the solution here so it can help others in the future.

    sjhuggins

    (@sjhuggins)

    Hello,

    Thanks SOOOOOOO much for posting this. I have been trying to do the same thing for a while and this got it done.

    My problem is now that i have gotten rid of the sidebar my header has disappeared and when I try to edit a page I get the following error:

    Warning: Cannot modify header information – headers already sent by (output started at /home3/shuggins/public_html/wp-content/themes/nuntius-child/functions.php:2) in /home3/shuggins/public_html/wp-admin/post.php on line 235

    Warning: Cannot modify header information – headers already sent by (output started at /home3/shuggins/public_html/wp-content/themes/nuntius-child/functions.php:2) in /home3/shuggins/public_html/wp-includes/pluggable.php on line 1121

    Any one else have this problem? I am doing my first website so I know literally nothing and am trying to learn.

    Thanks for any help!

    Moderator Kathryn

    (@zoonini)

    Automattic Happiness Engineer

    sjhuggins – I’ll reply in your own thread here:

    http://wordpress.org/support/topic/header-not-displaying-correctly

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘I need to remove the sidebar’ is closed to new replies.