• Resolved gdaytaiwan

    (@gdaytaiwan)


    Hi there

    I have a sidebar on certain pages and on all single posts, but now I want to remove them on all posts, without it affecting the pages.

    Could someone please show me the CSS. I tried playing around and ended up deleting it and had to restart again. Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi @gdaytaiwan,

    Please try adding the CSS below to your site in Appearance > Customize > Additional CSS.

    .single-post #secondary {
        display: none;
    }

    It should hide the sidebar on single posts. If it doesn’t, please let me know.

    I hope this helps 🙂

    Thread Starter gdaytaiwan

    (@gdaytaiwan)

    Thank you it does work!

    but now there is all that space in the sidebar. Any chance I can get rid of this to make the content full-width? Thanks.

    Sure. Please try adding this:

    @media screen and (min-width: 50em) {
    	.single-post .site-main {
    		margin: 0;
    	}
    }

    If the CSS doesn’t work, please let me know.

    Thanks 🙂

    • This reply was modified 6 years, 9 months ago by Gary Barrett.
    Thread Starter gdaytaiwan

    (@gdaytaiwan)

    Works like a charm!

    Thanks for all your help Gary!

    Thread Starter gdaytaiwan

    (@gdaytaiwan)

    Sorry one last thing.

    Just noticed that Galleries don’t centre automatically now that I’ve removed the space. Single photos are fine but Galleries are still aligning to the left as below:

    https://www.gdaytaiwan.com/2016/04/27/thebeardedman/

    • This reply was modified 6 years, 9 months ago by gdaytaiwan.

    For Jetpack galleries on single posts, please try using:

    .single-post .tiled-gallery .gallery-row {
        margin: 0 auto;
    }
    Thread Starter gdaytaiwan

    (@gdaytaiwan)

    Thanks Gary

    Really appreciate all your help!! The jetpack gallery is now centred but unfortunately captions and single photos are not! So strange…

    Here’s an example of the issues: https://www.gdaytaiwan.com/2016/07/15/taiwans-abandoned-the-thirteen-levels/

    To centre captions, please use:

    .wp-caption-text {
        text-align: center;
    }

    I’m unable to see any non-centered images at the url you posted. If there are some in a different post or page, please post a link to them.

    Thanks 🙂

    Thread Starter gdaytaiwan

    (@gdaytaiwan)

    Many thanks Gary
    works like a treat.

    As for the images, it was a simple centering of images, I thought I’ve done that already haha. But I am trying to make the images bigger in single posts. Do you know how I could make them full-width or even just to the margins?

    Many thanks Gary
    works like a treat.

    You’re welcome 🙂

    Do you know how I could make them full-width

    I see you’ve created a separate thread about that issue, which an Automattic Happiness Engineer has replied to.

    It’s best to keep the discussion about that in the thread that was created for it. This helps us to keep track of which issues have been resolved.

    If you need help with any other issue, separate to the one this thread was originally about (the sidebar), then please create a new thread.

    Thanks 🙂

    Thread Starter gdaytaiwan

    (@gdaytaiwan)

    ok no worries Gary. Just thought to ask you since you’re so good with responding.

    Hopefully i’ll here from Happiness Engineer soon!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘remove sidebar / widgets in single posts only’ is closed to new replies.