Prerequisites and Setup
- Any Media Library Organizer Pro license
- Media Library Organizer Pro 1.4.1 or higher
Overview
Dynamic Galleries allow image galleries to be embedded in WordPress content, where the contents (images) of the gallery are dynamically queried – for example, by Media Category, Author or Search Terms.
When editing a Page, Post or Custom Post Type using TinyMCE (whether the Classic Editor, or a supported Page Builder block/widget that uses TinyMCE), you’ll see a button in the Visual Editor to add a Dynamic Gallery:
Click this button, and a modal dialog window will be displayed, where you can specify several attributes for your Gallery.
Taxonomy Query
Taxonomy queries will display images in the Dynamic Gallery that do (or do not) belong to some (or all) of the specified Taxonomy Terms (such as Media Categories).
Attribute | Description |
---|---|
Include Media Categories | Start typing to search and specify one or more Categories. Images will be displayed that are assigned to these Categories. |
Include Media Categories Operator | Determines whether Images should have all or any of the Categories above assigned to be eligible for display in the Gallery. |
Exclude Media Categories | Start typing to search and specify one or more Categories. Images will be displayed that are not assigned to these Categories. |
Exclude Media Categories Operator | Determines whether Images should not have all or any of the Categories above assigned to be eligible for display in the Gallery. |
Authors
Authors will include or exclude images belonging to specified WordPress Users.
Attribute | Description |
---|---|
Include Author(s) | Start typing to search and specify one or more WordPress Usernames. Images will be displayed that were uploaded by user(s) chosen here. |
Exclude Author(s) | Start typing to search and specify one or more WordPress Usernames. Images will be displayed that were not uploaded by user(s) chosen here. |
Search Terms
Search Terms query images by a range of Attachment fields, such as the Title or Alt Text.
Attribute | Description |
---|---|
Search Terms | Specify freeform search terms or words. Images will be displayed that contain these search terms in the Title, Caption, Alt Text or Description. |
Title | Specify freeform search terms or words. Images will be displayed that contain these search terms in the Title. |
Alt Text | Specify freeform search terms or words. Images will be displayed that contain these search terms in the Alt Text. |
Caption | Specify freeform search terms or words. Images will be displayed that contain these search terms in the Caption. |
Description | Specify freeform search terms or words. Images will be displayed that contain these search terms in the Description. |
Custom Fields
Custom Fields allows for one or more conditions to be set, to query for images matching the given key/value pairs.
To add a Custom Field condition:
- Click the Add button
- Specify the Custom Field programmatic name (or key)
- Specify the value that the key must match
Multiple Custom Field conditions can be specified, repeating the above process. Where multiple Custom Field conditions are specified, all conditions must match for the image to be included in the Dynamic Gallery.
Querying Advanced Custom Fields
To query for images based on an ACF field’s value:
- Navigate to Custom Fields > Field Groups
- Create or edit a Field Group that is set to display on Attachments under the Location rule:
- Make a note of the applicable field’s Field Name (in this example, country)
- In Dynamic Galleries, navigate to Custom Fields
- Click the Add button
- Specify the Custom Field programmatic name (or key), based on the Field Name you made a note of above, and the value that the Field must match
Pagination
Pagination options, if enabled, display numerical and previous/next links within a Dynamic Gallery, if the number of images exceeds the Total Number of Images setting.
Attribute | Description |
---|---|
Enable Pagination | When checked / selected, pagination will be displayed if the Total Number of Images (per Page) setting is less than the total number of Images in the Gallery. |
Total Number of Images (per Page) | The maximum number of Images to display in the Gallery. When Pagination is enabled, this setting becomes the maximum number of Images to display per Page in the Gallery |
Pagination Position | If Pagination is enabled, whether to display the Pagination above, below or above and below the Gallery. |
Previous Link Label | The text to display for the Previous Page Link in the Pagination. |
Next Link Label | The text to display for the Next Page Link in the Pagination. |
Display Options
Display options determine the order of the image output, the number of columns to display, and the size of the images to display.
Attribute | Description |
---|---|
Order | Determines how to order the output of images found based on the above attributes. |
Link To | What each image should link to. |
Columns | The number of columns to display in the Gallery. |
Size | The size to display for each image. Sizes are WordPress registered image sizes. |
Insert Dynamic Gallery
Once you have defined the Dynamic Gallery settings, click the Insert button.
A [[media_library_organizer_dynamic_gallery]] shortcode will then appear in the TinyMCE Editor, comprising of the attributes defined above:
Viewing the Page will then display the images based on the Dynamic Gallery configuration:
[]