April 29, 2016 at 10:30 am #190409
Lead DeveloperLead Developer
I’m not sure if the gallery shortcode has an exists function, but if it does it would be something like this:
<?php if ( is_single() ) : if ( gallery_exists() ) : echo do_shortcode( '[ gallery shortcode ]' ); elseif ( has_post_thumbnail() ) : the_post_thumbnail(); endif; endif; ?>
Note: The above will not work because gallery_exists() is most likely not the function name.
- This reply was modified 7 years, 4 months ago by Tom.