Home › Forums › Support › Change background color on Single Post This topic has 17 replies, 2 voices, and was last updated 3 years, 5 months ago by Leo. Viewing 15 posts - 1 through 15 (of 18 total) 1 2 → Author Posts September 18, 2019 at 9:27 am #1012783 Muhammad Hi. I want to change the background color on single Post only. If i change the background color from customizer, it changed across site. I need to change for other than archives pages.. which essentially means only for single post and single page. September 18, 2019 at 9:56 am #1012814 LeoStaff Customer Support Hi there, Try this CSS: .single.separate-containers .inside-article, .page.separate-containers .inside-article { background-color: #000; } Adding CSS: https://docs.generatepress.com/article/adding-css/ Let me know if this helps π September 18, 2019 at 10:03 am #1012818 Muhammad it changes the background to black. I want to change background of the container on single post to white and not the post content background. September 18, 2019 at 10:14 am #1012833 LeoStaff Customer Support So the body background? Try this instead: body.single, body.page { background-color: #fff; } September 18, 2019 at 10:27 am #1012844 Muhammad Works like a charm. Thanks. Also how to centralize title of the post and Date and Author name. ? September 18, 2019 at 10:30 am #1012847 LeoStaff Customer Support Try this: body.single .entry-header { text-align: center; } Let me know π September 18, 2019 at 10:38 am #1012856 Muhammad it works on single post but at the same time it also centralizes headings on home page. I want it only single post. September 18, 2019 at 10:47 am #1012863 LeoStaff Customer Support Edited the CSS here: https://generatepress.com/forums/topic/change-background-color-on-single-post/#post-1012847 Let me know π September 18, 2019 at 11:09 am #1012882 Muhammad Works perfectly. and last thing. How to change width of title to 1020px? September 18, 2019 at 11:16 am #1012887 LeoStaff Customer Support Not possible to break out the title block from the content container. A workaround solution would be to create a header element with the template tag: https://docs.generatepress.com/article/header-element-overview/ https://docs.generatepress.com/article/header-element-template-tags/#post_title You can see some examples here: https://docs.generatepress.com/article/page-hero-examples/ Once you do that, I can provide the CSS to change the width of the header element. Let me know π September 18, 2019 at 11:26 am #1012901 Muhammad hi. I have created it. Please provide the CSS. Thanks. September 18, 2019 at 12:14 pm #1012950 LeoStaff Customer Support This should be the CSS: body .inside-page-hero.grid-container { max-width: 1020px; } You will want to wrap the template tag with <h1> like this: <h1>{{post_title}}</h1> September 18, 2019 at 12:22 pm #1012954 Muhammad thanks works perfectly. But how to reduce padding below the title and date and author. September 18, 2019 at 12:36 pm #1012968 LeoStaff Customer Support I would recommend adding the date and author along with the page title in the page hero content as well: https://docs.generatepress.com/article/header-element-template-tags/#post_date https://docs.generatepress.com/article/header-element-template-tags/#post_author Let me know π September 18, 2019 at 12:41 pm #1012973 Muhammad Thank you.. you have been very helpful. Appreciate it. Author Posts Viewing 15 posts - 1 through 15 (of 18 total) 1 2 → The topic ‘Change background color on Single Post’ is closed to new replies.