Title: One column in single.php
Last modified: January 1, 2017

---

# One column in single.php

 *  [kbayegan](https://wordpress.org/support/users/kbayegan/)
 * (@kbayegan)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/one-column-in-single-php/)
 * I am editing single.php in a child theme and I am trying to make it a single 
   column showing only a single post and nothing else. I succeed in every respect,
   I can remove the sidebar, but the page still behaves as if it is two columns 
   and I cannot get the text to expand the whole width of the page.
 * Here is my single.php, what ma I doing wrong, or what else should I do?
 *     ```
       <?php
       /**
        * The template for displaying all single posts
        *
        * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
        *
        * @package WordPress
        * @subpackage Twenty_Seventeen
        * @since 1.0
        * @version 1.0
        */
   
       get_header(); ?>
   
       <div class="wrap">
           <div id="primary" class="content-area">
       	<main id="main" class="site-main" role="main">
                   <?php
       	    /* Start the Loop */
       	    while ( have_posts() ) : the_post();
                       get_template_part( 'template-parts/post/content', get_post_format() );
                   endwhile; // End of the loop.
       	    ?>  
               </main><!-- #main -->
           </div><!-- #primary -->
       </div><!-- .wrap -->
   
       <?php get_footer();
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/one-column-in-single-php/#post-8608305)
 * there is possibly still a CSS class injected into the body tag, as long as you
   have active widgets in the sidebar.
 * try and add this into **functions.php** of your _child _theme:
 *     ```
       add_filter( 'body_class', 'twentyseventeenchild_custom_class', 12 );
       function twentyseventeenchild_custom_class( $classes ) {
           // correct classes on single post
           if( is_single() ) {
               unset( $classes[array_search('has-sidebar', $classes)] );
           }
           return $classes;
       }
       ```
   
 *  Thread Starter [kbayegan](https://wordpress.org/support/users/kbayegan/)
 * (@kbayegan)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/one-column-in-single-php/#post-8608405)
 * That works. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘One column in single.php’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/twentyseventeen/4.1/screenshot.
   png)
 * Twenty Seventeen
 * [Support Threads](https://wordpress.org/support/theme/twentyseventeen/)
 * [Active Topics](https://wordpress.org/support/theme/twentyseventeen/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/twentyseventeen/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/twentyseventeen/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [kbayegan](https://wordpress.org/support/users/kbayegan/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/one-column-in-single-php/#post-8608405)
 * Status: not resolved