Black Friday Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

Reply To: conditional tag for slideshow in hooks

Home Forums Support conditional tag for slideshow in hooks Reply To: conditional tag for slideshow in hooks

#190409
Tom
Lead Developer
Lead 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 4 years, 7 months ago by Tom.