Support » Fixing WordPress » Make posts in certain category full-width

  • Hello, my theme is default right sidebar and that works great for the entire site except posts from one category need to be full width. I’ve searched quite a bit for a how-to, but all the threads I find on the ‘net are three or more years old. I tried one of them but it didn’t work, so I think the new WordPress just doesn’t use the same code. All the coding is still WAY over my head, so I don’t know how to use exceptions at all, and really need a step by step. Anyone know how I can accomplish this?

    Thanks in advance for your time!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steve Stern

    (@sterndata)

    Guardian of the Interwebs

    What’s a link to your site and a post that should be full-width?

    Hi, sterndata, thank you for your response. Here is a link to one of the posts in the category “Newsletter” that I am attempting to make full-width:

    June 2015

    Moderator Steve Stern

    (@sterndata)

    Guardian of the Interwebs

    What you’re going to have to do is edit your theme’s single.php template.

    Add a conditional to test the category and, if the post is in the category “newsletter”, skip the call to get_sidebar(). Then you’ll have to add a lot of CSS to change the width of the main content area. Qualify the css with .category-newsletter to override the default for the post’s normal styling.

    This is probably best done in a child theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Make posts in certain category full-width’ is closed to new replies.