1
votes

On a Wordpress site I am maintaining, the client wants to have a different header image for the blog post than what appears in the thumbnail on the blog roll page and wherever the thumbnail to the blog post appears on the site.

Right now it seems that the featured image is used for both the header image and the thumbnail.

Is there a way where these images can be different?

Any help is appreciated, thanks!

1
This is a pretty broad question, with lots of answers. One way to do this would be to use a custom meta field to hold the path to a banner image.rnevius
As @rnevius said, there's several ways you could do this, depending on: what theme are you currently using? Are you able to create a child theme? Are you happy to use a plugin?Dre
This was passed on to me from another dev. I am only decent at wordpress also so it would be nice if it was a plugin. It is a custom theme built off supersimple framework.Jason Gonzales de Jesus

1 Answers

0
votes

If you do this through your theme files or if you develop a plugin, it is not easy to explain it here. But you can use a plugin and do this easily. 1. "Multiple Post Thumbnails" plugin. Install this on your site ( or download this file and include it on your functions.php file https://github.com/voceconnect/multi-post-thumbnails/blob/master/multi-post-thumbnails.php ) and add following code to use another post image.

if (class_exists('MultiPostThumbnails')) {
    new MultiPostThumbnails(
        array(
            'label' => 'Secondary Image',
            'id' => 'secondary-image',
            'post_type' => 'post'
        )
    );
}

After that you can call for images using,

get_the_post_thumbnail($post_type, $thumb_id, $post_id, $size, $attr, $link_to_original);

And also you can use add_image_size( $size_id, $width, $height, $hard_crop ); function to specify the size of the image.

  1. "Advanced Custom Field" Plugin Using this plugin you can do many more things. And you can add any numbers of post thumbnails using this. And almost all the other custom input types can be easily add to your theme.