Yes, you can create as many as you like. They just need unique ids for the same post type.
Thread Starter
ttmt
(@ttmt)
Is there an example of how to add more than a second image.
I tried like this.
if (class_exists('MultiPostThumbnails')) {
new MultiPostThumbnails(
array(
'label' => 'Secondary Image',
'id' => 'secondary-image',
'label' => 'third Image',
'id' => 'third-image',
'label' => 'fourth Image',
'id' => 'fourth-image',
'post_type' => 'post'
)
);
}
You just need to do this:
if (class_exists('MultiPostThumbnails')) {
new MultiPostThumbnails(
array(
'label' => 'Second Image',
'id' => 'second-image',
'post_type' => 'post'
)
);
new MultiPostThumbnails(
array(
'label' => 'Third Image',
'id' => 'third-image',
'post_type' => 'post'
)
);
}
OK, this is an old post but let me share with you the following code for more than two featured images, e.g. let’s say 5:
if (class_exists('MultiPostThumbnails')) {
$i = 5;
while ($i <= 5){
new MultiPostThumbnails( array('label' => 'Extra Featured Image '.$i, 'id' => 'extra-image-'.$i, 'post_type' => 'post') );
$i++;
}
}
I hope this is helpful for someone!