If you want to display the *attached* image gallery, from another post, you can use: [gallery id="123"] where the custom `id` attribute is the post ID. If you want limit the number of items in a gallery, you can use: [gallery maxitems="50"] where the custom `items` attribute is the maximum number of items to display. This attribute is supported by the following plugin: <?php /** * Plugin Name: The Gallery Shortcode - Maximum Number Of Items. * Description: Support the 'maxitems' attribute in the gallery shortcode * Plugin URI: http://wordpress.stackexchange.com/a/176937/26350 * Plugin Author: Birgir Erlendsson (birgire) * Version: 0.0.2 */ add_action( 'wp', function() { if( class_exists( 'GalleryMaxItems' ) ) { $o = new GalleryMaxItems; $o->init(); } } ); class GalleryMaxItems { private $maxitems; public function init() { add_filter( 'post_gallery', array( $this, 'post_gallery' ), 10, 3 ); } public function post_gallery( $output = '', $attr = array(), $instance = 0 ) { if( isset( $attr['maxitems'] ) ) { $this->maxitems = $attr['maxitems']; add_filter( 'query', array( $this, 'query' ) ); } return $output; } public function query( $sql ) { remove_filter( current_filter(), array( $this, __FUNCTION__ ) ); $limit = sprintf( " LIMIT 0, %d ", $this->maxitems ); $regex = '#LIMIT 0,\s\d+#'; if( false !== stripos( $sql, ' LIMIT ' ) ) $sql = preg_replace( $regex, $limit, $sql ); else $sql .= $limit; return $sql; } } // end class