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

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 7 years, 11 months ago by Tom.