Shortcodes
How to use shortcodes
Available shortcodes
ACPT exposes different shortcodes to display meta fields.
[acpt]
Display custom post-type meta fields.
Usage example:
It's possible to specify the post ID:
If not provided, the global $post
object will be used to get it.
[acpt_tax]
Display taxonomy meta fields.
Usage example:
It's possible to specify the term ID:
If no tid
or terms are provided, the get_queried_object()
is used to try to fetch the term ID.
[acpt_option]
Display an option page meta field.
Usage example:
Where page
is the page's slug.
[acpt_user]
Display user meta fields.
Usage example:
It's possible to specify the user ID:
If uid
is not provided, the user of logged-in user is used.
[acpt_media]
Display attachment meta fields.
Usage example:
In this case, it's mandatory to specify the attachment ID.
Other arguments
Here is the complete allowed arguments list:
box
Required
The box name
field
Required
The field name
width
The width (in px or %) of images (only for Image and Gallery fields)
height
The height (in px or %) of images (only for Image and Gallery fields)
target
dateFormat
The date format (only for Date field)
timeFormat
The time format (only for Datetime and time fields)
elements
The number of elements per row (only for Gallery field)
parent
The parent element (only for Repeater nested fields)
index
The numeric index of the nested field (only for Repeater field)
blockName
The parent block name
blockIndex
The numeric index of the nested field (only for Flexible field)
render
list
separator
Strings separator (only for Checkbox, Select Multi, and List fields)
classes
Additional CSS classes
Example: date field
Suppose you want to use a custom date format address.
Use the following syntax:
Example: email field
Suppose you have an email field and want to display it as mailto
link.
Do the following:
Instead, if you want to display just the email as a text string:
Last updated