[wd_asp elements=’search’ ratio=’100%’ id=1]

Multiple featured images for blog posts

13th January 2022

Wordpress - Show

elementor

WordPress gives you only space for one featured image. If I wanted to added more featured images there is such a plugin for that. Configuring it is another job, that people read the specs but cant understand it. This is the problem with the way many plugins make it difficult to understand how to add to your website. I will show you a two step way to get this plugin working.

multiple featured images
multiple featured images

1. Install plugin. Multiple featured images plugin wordpress website
2. Add my code to the functions.php file of your WordPress webbsite.

DONE…

featured images
featured images


add_filter( 'kdmfi_featured_images', function( $featured_images ) {

$args_1 = array(
'id' => 'featured-image-1',
'label_name' => 'Featured Image 1',
'label_set' => 'Set featured image 1',
'label_remove' => 'Remove featured image 1',
'label_use' => 'Set featured image 1',
'post_type' => array( 'page', 'post' ),
);

$args_2 = array(
'id' => 'featured-image-2',
'label_name' => 'Featured Image 2',
'label_set' => 'Set featured image 2',
'label_remove' => 'Remove featured image 2',
'label_use' => 'Set featured image 2',
'post_type' => array( 'page', 'post' ),
);

$args_3 = array(
'id' => 'featured-image-3',
'label_name' => 'Featured Image 3',
'label_set' => 'Set featured image 3',
'label_remove' => 'Remove featured image 3',
'label_use' => 'Set featured image 3',
'post_type' => array( 'page', 'post' ),
);

$featured_images[] = $args_1;
$featured_images[] = $args_2;
$featured_images[] = $args_3;

return $featured_images;
});

Now enter the Elementor Template for single posts

Find the block in the side by typing featured in the search bar, and drag to desired area.

featured2
featured2

The choose the selected image to show.

featured images 1
featured images 1

Hey presto – you now have multiple featured images.