Okay
  Public Ticket #2415024
Blog category header – colour overlay?
Closed

Comments

  •  3
    chargingarc started the conversation

    Hello,

     Is there any way I could use the post category colour or custom css to put an overlay fade on the post category banners?

    I'd like to do the red fade from the homepage

    saveourrivers.org

    on the header image for

    saveourrivers.org/campaigns/tumpen/

    Can you think of a way to do that?

     Regards,

    Peter

  •  2,979
    Andrew replied

    Hi Peter,

    Use the following custom css:

    .nectar-recent-post-slide .nectar-recent-post-bg:after, .single [data-post-hs="default_minimal"] .page-header-bg-image:after, .archive .page-header-bg-image:after {
        background: rgba(225, 24, 24, 0.35);
    }
    

    Hope this helps.

  •  3
    chargingarc replied

    Thanks for the speedy reply Andrew!

    Is there a way I can get the colour to be the category colour? So that the colour matches each category?

    The body has a class for each category eg .category-cynfal-hydro .category-139

    Can I use that to assign a different colour to .nectar-recent-post-slide ?


    Or might it be possible to call the category colour with a css variable? (The meta-category span that names the category above each post is coloured with the category colour). 

    Regards, Peter

  •  3
    chargingarc replied

    To hopefully make that clearer ... each of these three categories has a colour assigned ... blue, purple and red.

    Can I get the colour fade on .nectar-recent-post-slide to reflect that colour rather than all be the same?


    http://saveourrivers.org/campaigns/heart-of-kendal/

    http://saveourrivers.org/campaigns/cynfal-hydro/

    http://saveourrivers.org/campaigns/tumpen/

  •  2,979
    Andrew replied

    Hi Peter,

    Sorry for the late response

    Yes. you can use the category class at the body to uniquely have different category colours.

    Kind regards,

  •  3
    chargingarc replied

    Sorry for my lacking CSS knowhow ... I tried 

    body.category-tumpen .nectar-recent-post-slide .nectar-recent-post-bg:after, body.category-tumpen .single [data-post-hs="default_minimal"] .page-header-bg-image:after, body.category-tumpen .archive .page-header-bg-image:after {
        background: linear-gradient(rgba(246,101,60,1), rgba(246,101,60,0));
    }

    Tying to select the category header only if it's within body of class 'category-tumpen' (also known as .category-162)

    But now the gradient doesn't appear at all.

    Can you tell me how to select the header based on the class of the body?

    Regards, Peter


  •  2,979
    Andrew replied

    Hi Peter,

    The following css will work on the following link http://saveourrivers.org/campaigns/tumpen/

    body.category-tumpen .page-header-bg-image:after {
        background: linear-gradient(rgba(246,101,60,1), rgba(246,101,60,0));
    }
    

    Kind regards.

  •  3
    chargingarc replied

    Brilliant! Thank you so much for your help Andrew!

     Everything is working as I hoped now.

     Peter

  •  2,979
    Andrew replied

    Hi Peter,

    Glad that help. Feel free to reach back should you need help.

    Thanks.