Archived topic
Background Colour of Archive, Blog, Search vs Blog Posts
8 replies · Started by Ian on October 26, 2022
I would like to keep the background colour of Blog Posts to be grey. Running the new Query Loop to control archive template using Loop Content and now would like Archive, Blog, Search background colours to be white. Is there custom CSS that I can run for this?
I think these work for the archive and and blog sections. What about the search results section?
body.archive,
body.archive #page,
body.blog,
body.blog #page
{
background-color: #ffffff;
}
Hi there,
body.search-results would target the search results page.
You can always identify the unique tag by looking at the classes in the <body>:
https://www.screencast.com/t/vbF7hJemB
Awesome thank you Leo. May I ask if we need the #page as well?
body.search-results, body.search-results #page
Seems to work without the #page line.
May I ask if we need the #page as well?
That completely depends on what you are targetting.
In short, I want archives, blog page and search results to show a white background. I found the #page reference on this ticket: https://generatepress.com/forums/topic/content-block-archive-background-color/
Is this enough with the #page references?
body.archive, body.blog, body.search-results
{
background-color: #ffffff;
}
If this works for you:
body.archive, body.blog, body.search-results
{
background-color: #ffffff;
}
Then you don't need #page.
You can always try both versions to see the differences.
As always, thanks Leo!
No problem :)