Fallback Images
-
Code could probably be simplified, but this is how I handled having a fallback image in the event a MultiPostThumbnail wasn’t provided:
<?php if (class_exists('MultiPostThumbnails')) : if ( !has_post_thumbnail() ) : ?> <img src="<?php bloginfo( 'template_directory' ); ?>/i/generic.png" class="attachment-secondary-image" alt="<?php the_title(); ?>" /> <?php else : MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'secondary-image', NULL, 'secondary-image'); endif; endif; ?>
https://www.ads-software.com/extend/plugins/multiple-post-thumbnails/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Fallback Images’ is closed to new replies.