Multiple Featured Images WordPress

So my aim is to find a method of adding more thumbnails only for displaying on a custom post type, for example I wish to have a large image (not the same image) for a featured post and a different image for the default view.

Related posts

Leave a Reply

4 comments

  1. I got a solution from online. I also customized some code. You can check this.

    Step 1 Download this library from this link and put beside functions.php ( theme root ).

    Step 2: Copy this code below to functions.php.

    /*
     * Code for Multiple Featured Image.
     * Multiple Featured image is only for your selected post type.
     */
    require_once('library/multi-post-thumbnails.php');
    if (class_exists('MultiPostThumbnails')) {
    new MultiPostThumbnails(array(
        'label' => '2nd Feature Image',
        'id' => 'feature-image-2',
        'post_type' => 'your_post_type_name'
            )
    );
    new MultiPostThumbnails(array(
        'label' => '3rd Feature Image',
        'id' => 'feature-image-3',
        'post_type' => 'your_post_type_name'
            )
    );
    new MultiPostThumbnails(array(
        'label' => '4th Feature Image',
        'id' => 'feature-image-4',
        'post_type' => 'your_post_type_name'
            )
    );
    };
    

    Step 3 Check now.