Turn off image captions in gallery view?

I’ve set up my loop-attachment.php to show the gallery of thumbnails above the main, selected image using this code from the WordPress Codex:

<?php
    $gallery_shortcode = '
';
    print apply_filters( 'the_content', $gallery_shortcode );
?>

However, if the image has a caption, it shows up underneath its image, throwing off my neat little grid of images. I don’t want to turn captions completely off or not use them at all, because after the grid and below the main 960×540 image, I want to do an “Image Summary” kind of section, with the filename, original size, caption, description, etc.

Read More

Is there a way to turn off captions in the above code? The gallery shortcode section of the WordPress Codex doesn’t have anything on it.

Related posts

Leave a Reply

2 comments

  1. Or you can dynamically do it by jquery – may be do it on some condition

    ( function( $ ) {    
        //you can put this line of code after some condition function
         $( '.gallery-caption').css({display:'none'});
    
    } )( jQuery );