[gallery_select_field]
The shortcode is designed to generate a select dropdown field that allows users to choose a gallery from a list of available galleries.
Product
Shortcode Attributes
There are a number of shortcode attributes available which you can use to customise the output.
- label – The label text that will be displayed above the select dropdown.
- Options: Any text value.
- placeholder – The placeholder text that will be displayed in the select dropdown when no option is selected.
- Default:
Select Gallery. - Options: Any text value.
- Default:
- categories – Gallery Category IDs.
- Options: Any numeric value. Use commas
,to separate.
- Options: Any numeric value. Use commas
- tags – Gallery Tag IDs.
- Options: Any numeric value. Use commas
,to separate.
- Options: Any numeric value. Use commas
- orderby – Sort gallery items by a specific field.
- Default:
title. - Options:
id,date,title,menu_order,rand. Specify one only.
- Default:
- order – Order of the gallery items.
- Default:
asc. - Options:
asc,desc. Specify one only.
- Default:
Example Usage
[gallery_select_field label="Select a Gallery" placeholder="Choose a Gallery"]
[gallery_select_field categories="1,2" tags="3,4" orderby="date" order="DESC" label="Select a Gallery" placeholder="Choose a Gallery"]
Results
| Example 1: This example display a select dropdown with all available galleries, ordered by title in ascending order. Example 2: This example display a select dropdown with galleries that belong to categories with IDs 1 and 2, are associated with tags with IDs 3 and 4, and are ordered by date in descending order. |
gallery, the select dropdown will be empty.