Site logo

Archived topic

Using plugin to get images in element for category pages.

14 replies · Started by Joe on January 9, 2019

Viewing posts 1–15 of 15

Hello-

I would like to create a hero element for category pages and display a featured background image.

I found this plugin: https://wordpress.org/plugins/categories-images/

But I did not figure out how to integrate the code required to display the images to work.

Is there a way to do this?

Thanks!

Would appreciate some help with this, thanks!

Hmmm- nice plugin but still not working for me- the image set for the category still does not show up as background in the header in hero element.

How many categories do you have (plan on having)?

Maybe 30 max

i am not sure theres an easy way to get the category featured image to work in the header element. I will ask Tom.

In the meantime you would need to create a separate header element for each of the Categories and use the Custom Image background. Look for the Duplicate Post plugin on wordpress.org, install that and within the Dashboard > Settings > Duplicate - check the Elements field, this will allow you to easily create new drafts of an existing header element.

Ok thank you!

You could try this:

add_filter( 'generate_page_hero_background_image_url', function( $url ) {
    if ( is_category() && function_exists( 'z_taxonomy_image_url' ) ) {
        $image = z_taxonomy_image_url();

        if ( $image ) {
            return $image;
        }
    }

    return $url;
} );

That should work with the first plugin you mentioned :)

Thank you so much Tom, appreciate it! Will give this a shot.

No problem :)

Opps- logo disappearing now when I try to use a child theme with the functions file.

ok fixed the logo issue.

Ok thanks so much Tom, it works! Marking as solved.

Glad I could help :)

This archived topic is closed to new replies.