Get second featured image
-
Hi Ankit, thank you for the great plugin. I am sure I am close on this, but I cannot get the second image ONLY to display. I have two featured images on my post; I want to display the second featured image using this code.
I am using this within a loop.
if (function_exists('dfi_get_featured_images') ) { $featuredImages = dfi_get_featured_images(1); //get second featured image if( !is_null($featuredImages) ) { //if value is not null echo '<div class="featured-image featured-image-desktop hidden-xs">'; //create featured image wrapper foreach($featuredImages as $images) { echo '<img src="' . $images['desktop'] . "' />"; } echo '</div>'//close image wrapper } }
“desktop” is a custom image size I created in my functions.php file.
https://www.ads-software.com/plugins/dynamic-featured-image/
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Get second featured image’ is closed to new replies.