-
Author
-
December 16, 2014 at 15:20 #39296bernardworthyParticipant
Hi,
Quick question: I’d like to make the background a different color for all pages that display blog posts (ie: background: #e9e9e9 for main blog page, archive pages, search page, categories page, etc.). All other pages…buddypress, 404, etc. stay the same background: #fff.
However, it doesn’t seem to be as easy as changing settings in the theme options section. I don’t mind getting into the code if someone could explain which files need editing.
Thanks in advance and thanks for an awesome theme!
Bernard
December 16, 2014 at 15:45 #39297sharmstrModeratorHavent tested this, but you can probably copy header.php to your child theme and do a conditional check for the type of page you are on.
pseudo code
COPY CODE<?php if ( is_archive() || is_home() ) { $bgColor = '#e9e9e9'; } else { $bgColor = '#fff'; } ?> <body <?php body_class(); ?> style="background-color:<?php echo $bgColor; ?>;" itemscope itemtype="http://schema.org/WebPage">
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
December 16, 2014 at 16:21 #39300bernardworthyParticipantThank you for the quick response. This is a really helpful start!
It’s not exactly what I need to change the
<section class="container-wrap main-color">
How would I change your code so that main-color background-color is ‘red’ when the page displayed is home page or archive page?
Bernard
December 16, 2014 at 17:18 #39313sharmstrModeratorThat’s in page-parts/general-before-wrap.php
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.