Shortcode Parameters

If you’re using shortcodes to display your galleries, you can use different parameters to individually modify each gallery instance. Below is a list of available parameters.

Keep in mind that some parameters are not compatible together. For example, you cannot use both id and ids within the same shortcode, as they serve similar purposes and would conflict.

General Parameters

ParameterDescription
meowSet to "false" to use default WordPress gallery instead
idGallery ID from the Gallery Manager
idsComma-separated list of image IDs
includeAlternative way to specify image IDs
collectionCollection ID to display instead of a gallery
layoutGallery layout: tiles, masonry, justified, square, cascade, horizontal, carousel, map
sizeImage size to use (e.g., large, medium, thumbnail)
linkLink behavior: attachment, media, file, or null
captionsCaption display: none or other values
animationAnimation type for images
custom-classCustom CSS class for the gallery
alignAlignment (adds align{value} class)

Ordering

ParameterDescription
orderby / order_byField to order by
orderSort direction: asc or desc

Order by possible values:

  • none – No ordering (return as-is)
  • ids – Sort by post IDs
  • random – Shuffle images randomly
  • date – Sort by post creation date
  • modified – Sort by post modification date
  • filename – Sort by post title (filename)
  • title – Sort by post title (same as filename)
  • menu – Sort by menu order

Posts Mode

ParameterDescription
postsComma-separated post IDs (uses featured images)
latest_postsNumber of latest posts to fetch
heroEnable hero display mode for posts

Layout-Specific Parameters

Tiles

ParameterDescription
gutterSpace between tiles
densityTile density: low, medium, high

Masonry

ParameterDescription
gutterSpace between images
columnsNumber of columns

Justified

ParameterDescription
gutterSpace between images
row-heightTarget row height in pixels

Square

ParameterDescription
gutterSpace between images
columnsNumber of columns

Cascade

ParameterDescription
gutterSpace between images

Horizontal

ParameterDescription
gutterSpace between images
image_heightImage height in pixels
hide_scrollbarHide the scrollbar

Carousel

ParameterDescription
gutterSpace between slides
image_heightImage height in pixels
arrow_nav_enabledShow arrow navigation
dot_nav_enabledShow dot navigation
keep-aspect-ratioMaintain image aspect ratio

Map

ParameterDescription
gutterSpace between elements
map_heightMap height in pixels

Collections

You can group your galleries into collections, which act as galleries of galleries. When you click a gallery thumbnail inside a collection, it opens that specific gallery. You can then navigate back to the main collection view to browse the others.

Layouts

Menu

The Menu layout displays the first gallery by default and adds a header menu bar that your users can use to choose between the different galleries manually.

Bento

The Bento layout creates different boxes, one for each gallery inside the collection. You can click any card to open the related gallery.

Photo Engine (Lightroom Collections)

You can create collections directly from your WP/LR hierarchy without having to manually build galleries.

Simply copy and paste the shortcode provided by Photo Engine, and each collection in your folder structure will automatically become a gallery inside a Meow Collection.

Each collection is rendered as a gallery using your default gallery settings.

If you want to customize the galleries inside a Meow Collection directly through the shortcode, you can use any gallery shortcode attribute by prefixing it with gallery_.

For example, if a normal gallery would use:

[gallery layout="square"]

Then for a Meow Collection you would use:

[meow-collection wplr-folder="6" gallery_layout="square"]

This will apply the square layout to all galleries inside the collection.

Infinite Scroll

Meow Gallery can improve your site’s performance by loading media only when visitors scroll through the page. This prevents all images from being loaded at once during the initial page load, greatly improving loading speed and responsiveness.

In this setup, media files are loaded in batches of 12. As the user scrolls, new batches are automatically loaded.

You can also open the first image in the lightbox and navigate from there. The lightbox will dynamically load the next batch as you browse through the first one, keeping everything smooth and efficient.

Dynamic Sources

Instead of selecting your media files one by one, you can use dynamic galleries that automatically load images based on specific parameters.

Dynamic Mode

In the Gallery Manager, you can switch your gallery type from “Media” to “Dynamic.”

Once selected, you’ll be able to choose from different dynamic sources, each allowing you to automatically populate your gallery based on specific criteria. These sources are explained below.

Tags

You can set your source to Tags, and the gallery will automatically fetch all media that have at least one of the specified tags.

In the example below, all images tagged with “france” or “japan” will be automatically loaded into the gallery.

By default, WordPress does not use taxonomies for attachments. If you are not using a plugin and do not have a custom taxonomy registered, you will need to add one before you can assign tags to your media files.

By default, the most common WordPress tag taxonomies are used: ‘post_tag’, ‘media_tag’, ‘attachment_tag’ and ‘attachment_category’.

If you’d like to use tags from a custom taxonomy or a third-party plugin, you can use the following filter:

mgl_tags_taxonomies( $taxonomies_to_try )

$taxonomies_to_try should be an array of taxonomies that the gallery will check when fetching tagged media.

You can register tags for attachments using a simple snippet, as shown below:

function register_attachment_tags() {
    register_taxonomy(
        'attachment_tag',
        'attachment',
        array(
            'label'        => __( 'Media Tags' ),
            'rewrite'      => array( 'slug' => 'media-tag' ),
            'hierarchical' => false,
        )
    );
}
add_action( 'init', 'register_attachment_tags' );

Posts

You can then select specific posts or choose your X latest posts. For each of these posts, the featured image will be used.

With the Carousel layout, you can use Hero mode to overlay the post title and excerpt on the media, and users can click it to go directly to the post.

You can of course use it directly through a shortcode if you prefer to have your own logic:

[gallery layout="carousel" latest_posts="3" hero="true"]

Adobe Lightroom


You can use media directly from your Lightroom collections if you’re using WP/LR Sync (Photo Engine), since this plugin is directly compatible with Meow Gallery. Each of your Lightroom collections will have an ID that you can reference in a Collection or Gallery to display on your page. When your collection is updated in Lightroom and synced with WordPress, your gallery on your posts will automatically be updated with that content as well!

Real Media Library

If you’re using Real Media Library, Meow Gallery can automatically convert your folder, collection, or gallery structure into WordPress galleries.

You can simply reference the path of a folder in a gallery shortcode, and Meow Gallery will automatically include all of the media contained in that folder and its chilren.

You don’t have to enter the folder path manually. You can also use the Gallery Manager and select the Dynamic gallery type with Real Media Library, which will automatically configure everything for you.

This is also compatible with Meow Collections.

If you provide the path to a folder, each subcollection will automatically become a gallery within the collection.

If you provide the path to a collection, each of its gallery data folders will automatically become a gallery within that collection.

Posts attachments

Meow Gallery can automatically create a gallery based on the media attached to the current post.

You can enable this behavior either by using the attachments parameter in the shortcode or by enabling it directly in the block settings.

[gallery attachments="true"]

You can enable this by default on empty galleries by going to the plugin settings and turning on the “Use Attachments on Empty” option.

Shortcode Override

If you have some technical knowledge, you can do fantastic things by overriding attributes of the gallery. For instance, you can create your own attribute like “keyword”, and your gallery will always show media that match that keyword. You can also add a limit attribute to display only the latest X items you’re interested in.

[gallery keyword="water" limit="4"]
// functions.php or a plugin file
add_filter('shortcode_atts_gallery', function ($out, $pairs, $atts, $shortcode) {
    $keyword = isset($atts['keyword']) ? sanitize_text_field($atts['keyword']) : '';
    $limit   = isset($atts['limit']) ? absint($atts['limit']) : 0; // 0 means no limit

    if ($keyword !== '') {
        $args = [
            'post_type'      => 'attachment',
            'post_status'    => 'inherit',
            'post_mime_type' => 'image',
            's'              => $keyword,
            'fields'         => 'ids',
            'orderby'        => 'date',
            'order'          => 'DESC',
        ];

        if ($limit > 0) {
            $args['posts_per_page'] = $limit;
        } else {
            $args['posts_per_page'] = -1;
        }

        $ids = get_posts($args);

        if (!empty($ids)) {
            $out['ids']     = implode(', ', $ids);
            $out['orderby'] = 'post__in';
        }
    }

    return $out;
}, 10, 4);

Carousel

This is only available in the PRO version of Meow Gallery.

Casecade

Justified

Horizontal

Map

This is only available with the PRO version of Meow Gallery.

Masonry