[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.

  1. label – The label text displayed above the select dropdown.
    • Options: Any text value.
  2. placeholder – The placeholder text displayed in the select dropdown when no option is selected.
    • Default: Select Project.
    • Options: Any text value.
  3. categories – List of category IDs to filter projects by category.
    • Options: Any numeric value. Use commas , to separate.
  4. tags – List of tag IDs to filter projects by tags
    • Options: Any numeric value. Use commas , to separate.
  5. orderby – Specifies the field to order the projects.
    • Default: title.
    • Options: id, date, title, menu_order, rand. Specify one only.
  6. order – Specifies the order of the projects.
    • Default: asc.
    • Options: asc, desc. Specify one only.

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).
The shortcode assumes the existence of two custom taxonomies: project_cat (for categories) and project_tag (for tags).