How to add a 2nd “featured image” to a post?

This plugin has worked for me in the past:

http://wordpress.org/extend/plugins/multiple-post-thumbnails/

Or you could create a custom field – Advanced Custom Fields makes this very easy (and for the end user too):

http://plugins.elliotcondon.com/advanced-custom-fields/

This could be integrated by using the traditional ‘featured image’ as the slider image – ie leaving <?php the_post_thumbnail(); ?> or equivalent in the loop that makes your slider. Then when displaying the post, you could check if the post has a secondary image attached, and fall back to the featured image if not. Something like this with the Advanced Custom Fields Plugin (untested code):

<?php if (!( $secondary = get_field('secondary-image'))) {
    the_post_thumbnail(); // or however you like to do it
} else {
    echo wp_get_attachment_image($secondary);
} ?>

Leave a Comment