admin管理员组

文章数量:1429844

this is my site: / and I'm trying to change the background image page header overlay for each category. I have been looking at many forums but I didn't get with the correct answer.

For example: on this page / it should show a different background image page header overlay than this one: /

If anybody could help me with this I will be very grateful.

this is my site: http://styleofchamp/ and I'm trying to change the background image page header overlay for each category. I have been looking at many forums but I didn't get with the correct answer.

For example: on this page http://styleofchamp/category/futbol/ it should show a different background image page header overlay than this one: http://styleofchamp/category/tenis/

If anybody could help me with this I will be very grateful.

Share Improve this question asked Apr 25, 2019 at 14:38 Ma. Florencia Fernández CarusoMa. Florencia Fernández Caruso 31 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

This is probably the easiest method.

If you inspect the <body> tag by pressing F12 in your browser you will see it has a different class for each category. You can use this to target your header element for each specific category.

For example, this will change the image for category 6.

body.category-6 .page-header {
    background-image: url( http://styleofchamp/wp-content/uploads/2019/04/sabri-tuzcu-190600-unsplash-1.jpg ) !important;
}

Note: You can upload images via the file uploader and then just replace the correct path for the background-image URL.

CSS changes can be added to Appearance > Customize > Additional CSS

本文标签: categoriesChange background image page header overlay for each category