[terms] shortcode in the Docy theme is a versatile and useful tool for displaying taxonomy lists associated with various post types in WordPress. By default, it is configured to show the category list of a post, but its flexibility lies in its ability to showcase any taxonomy list through the use of the
See the shortcode-rendered output here.
- Basic Structure: The basic shortcode
[terms]without any attributes will display the category list of the current post.
- Example: In a post, simply writing
[terms]will automatically pull and display the list of categories that the post belongs to.
Custom Taxonomy Display
taxAttribute: To display a different taxonomy, use the
taxattribute within the shortcode.
- Example: If you want to display tags instead of categories, you would write
tax: Specifies the taxonomy type to display. This can be categories, tags, or any custom taxonomy registered in WordPress.
- Displaying Tags:
- This will show a list of tags associated with the post.
- Custom Taxonomy:
custom_taxonomywith the name of your custom taxonomy to display its terms.
- Check Taxonomy Registration: Ensure that the taxonomy you want to display is properly registered in WordPress.
- Styling and Appearance: The appearance of the taxonomy list will depend on the theme’s CSS. Customize the styles as needed to match your site’s design.
- Use in Relevant Contexts: This shortcode is most effective when used in contexts where the taxonomy information adds value to the content, such as in blog posts or custom post types.
[terms] shortcode in the Docy theme is a powerful tool for dynamically displaying taxonomy lists in WordPress. Its simplicity and flexibility make it suitable for a wide range of applications, enhancing the way taxonomies are presented on your website.