Archived topic
Change background color of comment section
3 replies · Started by Joshua on May 12, 2020
Hi!
I'm trying to change the background color of only the comment section on my posts. I've gotten halfway there by using the code from this post: https://generatepress.com/forums/topic/changing-color-of-comment-section/
However, if you look at the comment section currently, you will see that the color does not expand full width: https://joshuamayo.com/start-blog/#comment
I've got the comments.php file in my child theme because I've been making minor edits to it, is there something I can add in there perhaps to make the color full width? Or some CSS?
As always, thank you!
Hi there,
to do that would require you to remove the Comments form from its current location. Tom explains what to do here:
https://generatepress.com/forums/topic/move-comments-to-different-area/#post-1274565
Then further down on the same topic how to hook the form back in:
https://generatepress.com/forums/topic/move-comments-to-different-area/#post-1277317
The before_footer hook is full width.
Then we can help style with CSS if required.
Hi David,
That was exactly what I needed. Thank you so much!
For any Google searchers in the future I used this CSS:
#comments {
max-width: 1200px;
margin: 0 auto;
}
You can change the max-width to whatever you want. The "margin: 0 auto;" is what centers the comment section on your page.
Thanks again for pointing me in the right direction, David! You rock.
Happy to be of help!