[Resolved] Using plugin to get images in element for category pages.

Home Forums Support [Resolved] Using plugin to get images in element for category pages.

Home Forums Support Using plugin to get images in element for category pages.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #777462
    Joe

    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!

    #777478
    Joe

    Would appreciate some help with this, thanks!

    #777644
    David
    Staff
    Customer Support

    Hi there,

    give this plugin a shot, it should be self configuring whereas the other looks like you would need to edit the theme templates:

    https://wordpress.org/plugins/category-featured-images-extended/

    #777837
    Joe

    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.

    #777848
    David
    Staff
    Customer Support

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

    #777850
    Joe

    Maybe 30 max

    #777853
    David
    Staff
    Customer Support

    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.

    #778385
    Joe

    Ok thank you!

    #778465
    Tom
    Lead Developer
    Lead Developer

    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 πŸ™‚

    #778481
    Joe

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

    #778764
    Tom
    Lead Developer
    Lead Developer

    No problem πŸ™‚

    #778831
    Joe

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

    #778832
    Joe

    ok fixed the logo issue.

    #778834
    Joe

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

    #779310
    Tom
    Lead Developer
    Lead Developer

    Glad I could help πŸ™‚

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.