[project_select_field]
The shortcode displays a select dropdown field for projects.
Product
Shortcode Attributes
There are a number of shortcode attributes available which you can use to customize the output.
- label – The label text displayed above the select dropdown.
- Options: Any text value.
- placeholder – The placeholder text displayed in the select dropdown when no option is selected.
- Default:
Select Project. - Options: Any text value.
- Default:
- categories – List of category IDs to filter projects by category.
- Options: Any numeric value. Use commas
,to separate.
- Options: Any numeric value. Use commas
- tags – List of tag IDs to filter projects by tags
- Options: Any numeric value. Use commas
,to separate.
- Options: Any numeric value. Use commas
- orderby – Specifies the field to order the projects.
- Default:
title. - Options:
id,date,title,menu_order,rand. Specify one only.
- Default:
- order – Specifies the order of the projects.
- Default:
asc. - Options:
asc,desc. Specify one only.
- Default:
Example Usage
[project_select_field label="Choose a Project" placeholder="Select a Project" categories="1,2,3" orderby="date" order="DESC"]
Results
<div class="hic-simple-select-element select-posts" data-post-type="project">
<div class="input-group">
<label>Choose a Project</label>
<select class="hic-select-post">
<option value="" disabled="" selected="">Select a Project</option>
<option value="https://example.com/project/project-1/">Project 1</option>
<option value="https://example.com/project/project-2/">Project 2</option>
<!-- More project options -->
</select>
</div>
</div>
| Example: This example display a select dropdown field with the following characteristics: – A label saying “Choose a Project”. – A placeholder inside the dropdown saying “Select a Project”. – A list of projects filtered by the categories with IDs 1, 2, and 3. – The projects are sorted by their publication date in descending order (newest first). |
project_cat (for categories) and project_tag (for tags).