Use bootstrap for wordpress gallery? [closed]

The gallery shortcode is contained in the wp-includes/media.php file. There is a function gallery_shortcode( that does all work. About 25 lines down you find:

    $output = apply_filters( 'post_gallery', '', $attr, $instance );
    if ( $output != '' ) {
      return $output;
    }

This code goes out and runs any filters tethered to post_gallery, and if there is a result then it does not run it’s own code but exits with that filters output.

Okay, with all this known you can now create your own filter like this:

    function your_awsome_theme_post_gallery( $output, $attr, $instance ) {
      // your code here
    }

    add_filter( 'post_gallery', 'your_awsome_theme_post_gallery', 10, 3 );

Have a look at these two examples: