Site logo

Archived topic

Different image in the page header for each category.

21 replies · Started by David on July 11, 2022

Viewing posts 1–15 of 22

I have a blog with several categories. I'd like to have a different image in the page header for each category.
How can I do this?

At this moment the image in the page header changes to the last featured image of a blog post.

Thanks

Hi David,

In that case, you'll need to create multiple page headers and assign them individually to specific categories.

How can I do this? Is it just a matter of copy paste and assign?

Is your page header using a block element - page hero?

If so, yes, you can copy all content, and paste it into a new block element - page hero.

I would recommend doing one more step, selecting the very outside container block, duplicating it, and deleting the old one.
This step ensures that it generates a new set of IDs for the new container to avoid CSS conflicts.

Then you can assign the new block element to a specific category archive.

Yes, I use page hero.

Apparently I do something wrong because it doesn't work.

I select the page header, copy, create a new header element, paste in page hero, add a different background picture and choose the correct location.

So it's a header element, not a block element? Can you confirm?

While the new header element is created, did you exclude the new location from the old header element?

The type of the page header is block - page hero.

Can you link me to the 2 pages where I can see different page heroes?

I've sent you the link in private.

I deleted again the copy because it didn't work. As you can see one category has the featured image of the last blog, where it should be the picture of the category.

where it should be the picture of the category.

How did you add a picture of the category? I don't think there's a WP setting to add images for category archives, are you using a plugin for this?

Are you using a static image for the page hero of GOUD & ZILVER category archive and a dynamic image for the page hero of FINANCIEEL ONAFHANKELIJK?

The picture was originally the same for all categories (the picture in the page header). That's what i wanna change. I don't have a plugin to add pictures.

When I do a new blogpost, the featured image from the post also appears in the page header of this category. So it's definitely not static. But that's not what i want. I want a fixed image but different for each category.

When I do a new blogpost, the featured image from the post also appears in the page header of this category

The background image is set to dynamic, so make sure the dynamic option is disabled (select None for the dynamic background image option) like this :
https://www.screencast.com/t/HITKwtAWs

Thanks, one issue less...

So where are we now?

I still have a problem with the different pictures for each category in the header.

When I create a new element for the header (page hero), change the picture and add a location, exclude from the old header, I still don't see any change.

This archived topic is closed to new replies.