Sidebar on Category pages

I would like to know where I can change the default template for my category pages, although my main template for the blog is currently full width and I would like to keep it that way?

I only want my category pages to have a sidebar on them.

  • Thanks!

Hi @jambesdeplomb,

I hope you are well today and thank you for your question.

You can try achieving this by adding the following CSS code in the Custom CSS option of the latest version of Sparkling theme on the below path.

Admin Area -> Appearance -> Customize -> Sparkling Options -> Other -> Custom CSS

@media (min-width: 992px){
.archive.category .main-content-inner.col-sm-12.col-md-8 {
    width: 66.66666667%;
}
.archive.category #secondary.col-md-4 {
    display: block;
}
}

Best Regards,
Movin

Hi @movin,

This trick seems to work on my posts pages but not on my category pages.

The sidebar shows up under the post previews, any idea why it does that?

Could you please share me the pages URLs from your site where you want to display it and where you want to hide it so that i can help you to achieve it?

I can’t, because I’m building the website on my localhost with Serverpress for now…

Ok then please share the screenshot of whole page so that i can help you.

Also tell me what sidebar layout you have set for the category pages or for all page son your site.

Hi Movin,

I wish to have full width on my home page (that’s what I actually have as a preset), I want to have à right sidebar on my category pages and I have the right sidebar on my post pages (that’s what i wanted and that’s what I have right now).

The only thing I need for now is to have the right sidebar on my category pages, my other pages are good, I do not wish to change them.

Thanks again for your quick reaction !

I wish to have full width on my home page (that’s what I actually have as a preset), I want to have à right sidebar on my category pages and I have the right sidebar on my post pages (that’s what i wanted and that’s what I have right now).

To achieve this you have to do this reverse. You have to set Right sidebar layout in the theme settings instead of Full width layout then we can make your home page full width by using CSS code so for that please tell me whether your home page is blog page or static front page.

The home page shows the latest posts. I switched the default layout to right sidebar.

Ok then to make your home page full width try using the below CSS code.

body.home .main-content-inner {
    width: 100%;
}
body.home #secondary {
    display: none;
}

Thanks @movin,

But now the image doesn’t go the same width as the rest of the block…

See image in attachment.

  • Thanks for the support !

If it is featured image then you have to change its size to make it full width by using the custom plugin solution shared in the following topic.

https://colorlibsupport.com/t/how-can-i-stop-resizing-featured-images/