Support » Theme: Twenty Twenty-One » CSS Styling Posts and Not Pages

  • I want to create some custom styles for all single posts but I don’t want to change the style of single pages. What do I need to add to specify this is for posts only?

    The biggest thing I want to change right now is the max-width. The rest of the site is full width but I want my blog posts to be 1200 pixels wide. Thanks in advance.

Viewing 1 replies (of 1 total)
  • Hi!
    I wouldn’t recommend to do that… The theme is made to make the most of the blocks.
    Have you tried to, for instance,
    1) add paragraph block
    2) group that block
    3) set the group to full width?

    That being said, with the following snippet you’ll change the width of single posts only, and on big screens

    @media (min-width:48em) {
    	/*Expand width for single posts in big screens*/
    .single .entry-content > *:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.wp-block-separator):not(.woocommerce),
    *[class*=inner-container] > *:not(.entry-content):not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.wp-block-separator):not(.woocommerce),
    .default-max-width {

    I hope this helps you!

Viewing 1 replies (of 1 total)
  • The topic ‘CSS Styling Posts and Not Pages’ is closed to new replies.