| 开发者 | mdforiduddin |
|---|---|
| 更新时间 | 2026年1月14日 03:05 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[current_post] → Outputs the current post title, e.g., "Hello World"[current_post meta="custom_field"] → Outputs the value of the custom field[current_post id="123"] → Outputs the title of the post with ID "123"[current_post id="123" meta="custom_field"] → Outputs the value of the custom field in the post with ID "123"[current_post meta="custom_field" default="Default Value"] → Displays "Default Value" if the custom field is empty
Display Default Value for Zero Meta Value:
[current_post meta="custom_field" default="Default Value" skip="true"] → Displays "Default Value" if the custom field value is zero
[current_post] to display the title of the current post.[current_post meta="custom_field"] to display a custom field value.id attribute.Yes, you can use these shortcodes anywhere shortcodes are supported in WordPress, such as posts, pages, widgets, Gutenberg blocks, and page builders like Elementor, Divi, WPBakery, etc.
You can use the skip attribute to skip empty or zero values and optionally display a default value.
Yes, you can use the default attribute to provide a fallback value for empty meta values.