If no image, show default featured image (fallback)
-
Hi there,
I’ve been trying to make a condition that will do the following: if there is NOT an image selected on ‘Dynamic-featured-image’ Plugin, then show the default Featured Image (from WordPress)
Would that be possible?
I’d be starting with the following code:
<?php if( class_exists('Dynamic_Featured_Image') ) { global $dynamic_featured_image; $featured_images = $dynamic_featured_image->get_featured_images( get_the_ID() ); foreach( $featured_images as $image ) { echo "<header id='masthead' class='site-header' role='banner' style='background-image: url({$image['full']});'>"; ?>
https://www.ads-software.com/plugins/dynamic-featured-image/
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘If no image, show default featured image (fallback)’ is closed to new replies.