What is Dynamic Galleries or Playlists?Enhanced Media Library
Dynamic galleries or playlists means you do not need to re-create a gallery or a playlist each time you (re)-assign media items to categories.
Enhanced Media Library allows to enhance WordPress native media shortcodes gallery
and playlist
to make them understand media taxonomies, upload date, and media items number limit. Such taxonomy-based shortcode will always display media items that belong to a particular category in real time.
Learn more about native WordPress gallery shortcode attributes or playlist shortcode attributes.
Available attributes
In addition to the WP built-in gallery and playlist attributes.
For the gallery
and playlist
shortcodes:
media_category
or any other taxonomy namemonthnum
year
limit
of media items to show
Examples of usage
Note: For performance it’s better to use IDs instead of slugs in the gallery shortcodes.
gallery media_category="foods"
Displays all the images from the media category Foods.gallery media_category="foods,drinks"
Displays images either from the Foods or Drinks category.
Notice that we use slugs for Foods and Drinks, respectfullyfoods
anddrinks
.gallery country="ukraine" year="2024"
Displays images form the media taxonomy Country. How to create a taxonomy.playlist media_category="15"
Displays WP playlist with the media files from the media category with the ID 15.
Using IDs instead of slugs is more preferable for performance.
Activate dynamic galleries and playlists
The feature is inactive by default and should be activated on Settings
⟶ Media Library
⟶ Media Shortcodes
(section).