You can use get_nth_featured_image method to get and display 2nd featured image anywhere you want.
Regards,
Ankit
please can you give me a little tuto how to do it? i saw this on a post but now what to add to functions.php
<?php
/** single product featured image (second featured image)
*
*/
if (function_exists('dfi_get_featured_images') ) {
$featuredImages = dfi_get_featured_images( $returnedArray[1] );
if( !is_null($featuredImages) ) {
echo '<div class="featured-image featured-image-desktop hidden-xs">'; // featured image wrapper
foreach($featuredImages as $images) {
echo '<img src="' . $images['full'] . '" />';
}
echo '</div>';
}
}
?>
You can do something like this. Please read comments too.
<?php
if( class_exists('Dynamic_Featured_Image') ) {
global $dynamic_featured_image;
$featured_images = $dynamic_featured_image->get_featured_images( get_the_ID() );
//If you want to display all featured images you can loop through the image to display them as required
foreach( $featured_images as $image ) {
echo "<a href='{$image['full']}'>";
echo "<img src='{$image['thumb']}' alt='Dynamic Featured Image' />";
echo "</a>";
}
//if you only want to show 2nd featured image you can do
if (isset($featured_images[0])) {
$image = $featured_images[0];
echo "<a href='{$image['full']}'>";
echo "<img src='{$image['thumb']}' alt='Dynamic Featured Image' />";
echo "</a>";
}
}
Regards,
Ankit