[post_select_field]
The shortcode designed to generate a post dropdown select field to navigate.
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 dropdown field.
- Options: Any text value.
- placeholder – The placeholder text displayed in the dropdown field before a post is selected.
- Default:
Select Post. - Options: Any text value.
- Default:
- categories – List of category IDs to filter posts by.
- Options: Any numeric value. Use commas to separate.
- tags – List of tag IDs to filter posts by.
- Options: Any numeric value. Use commas to separate.
- orderby – Specifies the criteria for ordering the posts.
- Default:
title. - Options:
id,date,title,menu_order,rand. Specify one only.
- Default:
- order – Specifies the order of the posts.
- Default:
asc. - Options:
asc,desc. Specify one only.
- Default:
Example Usage
[post_select_field]
[post_select_field label="Choose a Post" placeholder="Select a Post" categories="1,2" orderby="date" order="DESC"]
| Example 1: This example displays a dropdown list of posts with the placeholder “Select Post”. Example 2: This example displays an HTML dropdown field with the label “Choose a Post” and the placeholder “Select a Post”, showing posts from categories 1 and 2, ordered by date in descending order. |