[post_published_date]

The shortcode displays the published date of a post.


Product


Shortcode Attributes

  1. id – Post ID whose featured image you want to display.
    • Options: Any valid post ID.
  2. label – A label above the featured image.
    • Options: Any text value.
  3. date_format – Used to change the returned date format.

Shortcode Enclosed Content

Any content placed between [post_published_date] and [/post_published_date] will be used as a template, where {content} acts as a placeholder for the post published date.


Example Usage

Example 1

[post_published_date id="123"]

Results

This example returned the published date of post ID 123.
If no ID is provided, the shortcode will automatically use the ID of the current post/page.

Example 2

[post_published_date date_format="F j, Y"  label="Published on:"]

Results

<label>Published on:</label>
February 27, 2025
This example returned the published date with specify a custom date format and a label before the date.

Example 3

[post_published_date]This post was published on {content}.[/post_published_date]

Results

This example returned custom content, using {content} as a placeholder for the date:
This post was published on 27/02/2025.