BACK TO DIRECTORY

Current Post Shortcode

by Md Forid Uddin

0.0
(0 ratings)

The “Current Post Shortcode” plugin allows you to display post titles and custom field values using simple shortcodes. You can display the current post’s title or meta information, or specify a post ID to retrieve data from a specific post.

Display Current Post Title and Meta Information:

  • Post Title: [current_post] Outputs the current post title, e.g., “Hello World”
  • Post Meta (Custom Field): [current_post meta="custom_field"] Outputs the value of the custom field

Display Data from a Specific Post ID:

  • Post Title: [current_post id="123"] Outputs the title of the post with ID “123”
  • Post Meta (Custom Field): [current_post id="123" meta="custom_field"] Outputs the value of the custom field in the post with ID “123”

Display Fallback Meta Value:

[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

Plugin Details

Active Installs
50
Total Downloads
898
Version
3.1.0
Requires WP
6.7
Requires PHP
7.4
Tested Up To
6.9.7
Added
2025-03-12
Last Updated
2026-01-13 7:05pm GMT

Ratings

5
0
4
0
3
0
2
0
1
0