- This topic has 3 replies, 2 voices, and was last updated 4 years ago by
Fernando.
-
AuthorPosts
-
February 14, 2022 at 5:51 pm #2118793
Charles
Is it possible to have a different color background for different pages?
I want my home page to have one color but other pages to have a different color.
How would I do this? Does this require special coding?
February 14, 2022 at 8:37 pm #2118874Fernando Customer Support
Hi Charles,
Yes, this is definitely possible. You would need custom code to achieve this, and there might also be third party plugins that offers this kind of functionality.
Here is a sample CSS you may add by going to Appearance > Customize > Additional CSS:
body.page.page-id-1365 { background-color: rgb(0,0,0); }Kindly replace the page id(1365) with the id of the specific page: https://share.getcloudapp.com/7Kuqll05
Moreover, here is a link you may refer to for more information regarding this: https://cleversequence.com/how-to-change-the-background-color-of-a-single-page-in-wordpress/#:~:text=WordPress%20Page%20Builder-,Step%204%3A%20How%20To%20Change%20The%20Color%20Of%20A%20Single%20Page%20In%20WordPress,-Now%2C%20you%20should
Here is an online color picker: https://www.rapidtables.com/web/color/RGB_Color.html
I also found this Plugin, however I’m not sure how it works: https://wordpress.org/plugins/change-background-color-for-pages-posts-widgets/
Hope this helps! 🙂
March 23, 2022 at 5:27 pm #2165270Charles
Yes, that helps, but what if I want to change all the pages in my blog to be a different color from the rest of my site? So, I’m not just changing one page, but all my blog posts.
March 23, 2022 at 6:42 pm #2165298Fernando Customer Support
I see.
If that’s the case, you may use a CSS like this:
body.single-post { background-color: var(--contrast); }This would target all Single Post pages(Blog posts).
You may replace
var(—contrast)withrgb(0,0,0)or retain it.contrastis a Global color from Appearance > Customize > Colors. You may choose a different Global color by replacingcontrastwith the CSS variable name of the Global color you wish to use. This would simply allow you to control it from the Customizer.Example: https://share.getcloudapp.com/qGu7AmQ9
Hope this clarifies. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.