• Resolved mod keys

    (@willibrown)


    I want to remove sidebar from single posts. I deleted the get_sidebar but the template hierarchy is still laying out the page as two columns… thus giving an empty sidebar container. I have twentyseventeen child theme, with sidebar enabled. (Wanted sidebar on main blog page, author, categories, etc.).

    My research told me to create a single-post.php (copied from single.php in the parent) and delete the get sidebar call. Then add CSS to my child theme style.css like so:

    @media screen and (min-width: 56.875em) {
    	.single-post .content-area
    	{
    	  float: left;
    	  margin-right: -100%;
    	  width: 100%;
    	}
    }

    But it isn’t working. Here’s a post sample: https://techpoet.net/wordpress-4-7-released/ but note that I’m continuing to work on this problem…

    By the way, it looks like this line (parent css) is being invoked

    .has-sidebar:not(.error404) #primary {
    		float: left;
    		width: 58%;
    	}

    I assume now that I need to add a class to css and to the template…

    • This topic was modified 7 years, 9 months ago by mod keys.
Viewing 2 replies - 1 through 2 (of 2 total)
  • try to use:

    @media screen and (min-width: 48em) {
    	.single-post.has-sidebar:not(error404)  #primary 
    	{
    	  float: left;
    	  margin-right: -100%;
    	  width: 100%;
    	}
    }
    Thread Starter mod keys

    (@willibrown)

    Fixed! I had tried it but with a space between the two classes e,g,
    .single-post .has-sidebar:not(error404) #primary

    Thank you @alchymyth

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove Two Column From Single Post’ is closed to new replies.