- This topic has 17 replies, 2 voices, and was last updated 5 years, 6 months ago by
Leo.
-
AuthorPosts
-
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 #1012814Leo
StaffCustomer SupportHi 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 #1012818Muhammad
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 #1012833Leo
StaffCustomer SupportSo the body background?
Try this instead:
body.single, body.page { background-color: #fff; }September 18, 2019 at 10:27 am #1012844Muhammad
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 #1012847Leo
StaffCustomer SupportTry this:
body.single .entry-header { text-align: center; }Let me know 🙂
September 18, 2019 at 10:38 am #1012856Muhammad
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 #1012863Leo
StaffCustomer SupportEdited the CSS here:
https://generatepress.com/forums/topic/change-background-color-on-single-post/#post-1012847Let me know 🙂
September 18, 2019 at 11:09 am #1012882Muhammad
Works perfectly. and last thing. How to change width of title to 1020px?
September 18, 2019 at 11:16 am #1012887Leo
StaffCustomer SupportNot 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_titleYou 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 #1012901Muhammad
hi. I have created it. Please provide the CSS. Thanks.
September 18, 2019 at 12:14 pm #1012950Leo
StaffCustomer SupportThis 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 #1012954Muhammad
thanks works perfectly. But how to reduce padding below the title and date and author.
September 18, 2019 at 12:36 pm #1012968Leo
StaffCustomer SupportI 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_authorLet me know 🙂
September 18, 2019 at 12:41 pm #1012973Muhammad
Thank you.. you have been very helpful. Appreciate it.
-
AuthorPosts
- The topic ‘Change background color on Single Post’ is closed to new replies.