- This topic has 14 replies, 3 voices, and was last updated 7 years, 3 months ago by
Tom.
-
AuthorPosts
-
January 9, 2019 at 9:34 am #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!
January 9, 2019 at 10:04 am #777478Joe
Would appreciate some help with this, thanks!
January 9, 2019 at 1:49 pm #777644David
StaffCustomer SupportHi 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/
January 9, 2019 at 6:22 pm #777837Joe
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.
January 9, 2019 at 6:54 pm #777848David
StaffCustomer SupportHow many categories do you have (plan on having)?
January 9, 2019 at 7:01 pm #777850Joe
Maybe 30 max
January 9, 2019 at 7:06 pm #777853David
StaffCustomer Supporti 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.
January 10, 2019 at 8:00 am #778385Joe
Ok thank you!
January 10, 2019 at 9:07 am #778465Tom
Lead DeveloperLead DeveloperYou 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 🙂
January 10, 2019 at 9:20 am #778481Joe
Thank you so much Tom, appreciate it! Will give this a shot.
January 10, 2019 at 4:34 pm #778764Tom
Lead DeveloperLead DeveloperNo problem 🙂
January 10, 2019 at 7:47 pm #778831Joe
Opps- logo disappearing now when I try to use a child theme with the functions file.
January 10, 2019 at 7:52 pm #778832Joe
ok fixed the logo issue.
January 10, 2019 at 7:57 pm #778834Joe
Ok thanks so much Tom, it works! Marking as solved.
January 11, 2019 at 8:31 am #779310Tom
Lead DeveloperLead DeveloperGlad I could help 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.