Support » Theme: Quark » Have banner background/color be different on !is_front_page

  • Resolved jcervantes28



    Is there a way to have the background/color of the banner be different on single posts, pages, etc. than on the home page? I like the color, but don’t want it to expand the width it would normally take with 2 widgets embedded into it like in the home page.

    Thank you for your help and time,

Viewing 8 replies - 1 through 8 (of 8 total)
  • Use the code I’ve pasted in

    Pasting it in the functions.php file will work but updating the theme will overwrite it. So create a child theme and paste the code in its functions.php file.

    Hello Jesin,

    Thank you for the help…it is pushing me along the right lines and I’m looking into it.

    The code you referenced did what I needed to do, except that it did it in the container that goes above the banner. I change the #headdercontainer to #bannercontainer, and while I think it works, the background attachment that is configured in the theme options takes precedence, I believe.

    So I am looking into the theme’s function php at where it defines the background URL, I just don’t know how to make it be my color I want, without the background, on !is_front_page.

    Let me know if that made sense. I appreciate your help.

    Hi Jose,

    Do you mean that some other CSS is overriding the style you’ve added?

    Can you post your site’s URL for me to take a look.

    Might be CSS, not sure. But I know I see the URL being defined in functions.php, it probably refers to the background that we select through the theme’s options.

    I didn’t see the background URL in CSS, but it would make sense to be there.

    I want that background in home page, but when it is not a home page, I don’t want a background within the banner. I simply want a color, like #0000FE.

    website is:

    I want to customize the site more by adding my own colors, and that’s one way I want to do it.

    Thank you,

    If you just do not want to display an image inside #bannercontent add this in the else part (line 13 of the pastebin link)

    background-image: none;

    If you don’t want to display the #bannercontent itself use

    display: none;

    instead. Try both and use the one that suits you.

    Whatever you do just don’t edit your functions.php file. All changes will be overridden if the theme is updated.

    Thank you Jesin!

    I did it with the following code:

    function my_inline_styles()
    <style type="text/css">
    <?php if(is_front_page()): ?>
    #bannercontainer {
      background-color:#6666FE !important;
    <?php else: ?>
    #bannercontainer {
    background-image:none !important;
    background-color:#6666FE !important;
    <?php endif; ?>

    Of course, I did it in the Child theme 🙂 Thanks for your support!


    marking solved.

    Theme Author Anthony Hortin


    For reference, if you simply need to make some style changes, and you’ve built a child theme, then add them straight into the style.css file. That’s what it’s there for. You shouldn’t be using a function within functions.php to add them to the site <head>.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Have banner background/color be different on !is_front_page’ is closed to new replies.