- This topic has 5 replies, 3 voices, and was last updated 4 years, 11 months ago by
David.
-
AuthorPosts
-
April 24, 2021 at 7:25 am #1747221
crosby87
Hi,
I am using seperate containers of my website, so on my blog the background is grey and the content background is white (this was basically default setting). I like this and I would like to keep it as it is.
For some specific pages, however, I would like both the content and background color to be white.
Please see example of a specific page I am talking about: https://imgur.com/undefined
As you can site the content is white, while the background on the two sides is grey. How can I set the color of the background completely white for some specific pages?
I think I need to use hooks just not sure what code should I use, what type of hook etc.
Thanks for your help in advance!
April 24, 2021 at 5:43 pm #1747531Ying
StaffCustomer SupportHi there,
You screenshot doesn’t work, I guess you mean the body background is grey?
You can try this CSS:
body.page-id-116 { background-color: #fff; }In above CSS,
page-id-116is your contact page, you’ll need to find out what’s the page ID of the page you want to change.If you are using Chrome, go to the page, right-click > inspect, you’ll find the page id there:
https://www.screencast.com/t/IVAkRbBLrLet me know 🙂
April 24, 2021 at 10:14 pm #1747631crosby87
Thanks for the answer.
I tried the above code with the page’s own ID, but it doesn’t seem to work.
Is there any way you could give a code that I can use in Elements Hooks? That way I could apply this specific code to multiple pages that I select, correct?
Here’s the screenshot again (sorry for before): https://imgur.com/RahKYHo
April 25, 2021 at 5:07 am #1747906David
StaffCustomer SupportHi there,
create a new Hook Element.
Add this code to the element text area:<style> body { background-color: #fff; } </style>Set the Hook to:
wp_headand set the Priority to50( That will hook the style in later so it comes after the Customizer settings ).Then set your Display Rules to the pages you need.
April 25, 2021 at 5:23 am #1747915crosby87
Hi David,
Many thanks for the reply – amazing customer service!
The code works perfectly.
I created a layout element as well whereby for some specific pages I removed the Sidebar. Thats the only thing I did, but the position of the blog post’s title suddenly changed.
Now it basically touches the menu: https://imgur.com/9VGZgLP
Could you please tell what causes this (only thing I did is remove sidebar) and how I can increase the spacing again?
Many thanks!
April 25, 2021 at 7:05 am #1748236David
StaffCustomer SupportIn the Layout Element – set the Content Container back to default. The width you have set will still apply.
Using either the Full Width or Contained options removes the Themes padding – they should be used if you want to rebuild all the content of page using something like GenerateBlocks or a Page Builder.
-
AuthorPosts
- You must be logged in to reply to this topic.