Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to be able to use the 'featured image' functionality, found on post types, for a custom taxonomy.

I have a taxonomy called 'collections' and I would like each collection to have a featured image. I will then use the featured image in a custom template that will show all of the collection, their titles and featured images.

I need the uploaded image to be resized into the custom image sizes that I have set in my theme.

There is a similar question here: Can I set a default featured image for a category? However, the top answer won't work for me, and I can't rely on a plugin.

Can anyone help?

Many thanks,

Keith

share|improve this question
1  
if you want to use a plugin here is the best one for it. wordpress.org/extend/plugins/taxonomy-images If you don't want to use any plugin you can checkout the plugin code to add codes to your theme. –  Sisir Dec 15 '11 at 19:36

1 Answer 1

It's a little complex, but you can add custom meta to taxonomies. http://pippinsplugins.com/adding-custom-meta-fields-to-taxonomies/

You could pretty easily integrate a WP media uploader field that would allow you to enter an image into the field.

share|improve this answer
    
why pass 2 parameters 'add_action( 'edited_category', 'save_taxonomy_custom_meta', 10, 2 );' when the function only has 1 argument? Thanks. –  Christopher Ickes Jun 27 '12 at 18:48
    
The function accepts two parameters, but two don't have to be passed. –  Pippin Jun 27 '12 at 19:44
    
Why not leave it is add_action('edited_category', 'save_taxonomy_custom_meta'); instead? I have seen this in a few examples where the function only accepts one parameter but the add_action declares 2. Just wondering why this would be. Thanks. –  Christopher Ickes Jun 28 '12 at 15:33
    
If the function can have 2 parameters, then the 2 should be set in the add_action, but it does not have to be set in the call back function. –  Pippin Jun 28 '12 at 17:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.