This topic has 3 replies, 2 voices, and was last updated 10 years by sharmstr.

  • Author
  • #39296
     bernardworthy
    Participant

    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

    #39297
     sharmstr
    Moderator

    Havent 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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #39300
     bernardworthy
    Participant

    Thank 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

    #39313
     sharmstr
    Moderator

    That’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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?