A “published date” shortcode can be created and placed in your functions.php document to be used in various places in your pages, posts, or site sections.

PHP

Place the following code anywhere in your theme’s functions.php document.

				
					// shortcode for date published
function shortcode_post_published_date() {
    return get_the_date();
}
add_shortcode( 'post_published_date', 'shortcode_post_published_date' );
				
			

Then, in any place you’d like to use it on your site, you can open a “text editor” widget or “shortcodes” widget or “html” widget and place the following.

				
					Date Published: [post_published_date]
				
			

If you prefer, you can place the following in one of your theme’s templates where you want the published date to appear.

				
					Date Published: <?php echo do_shortcode( '[post_published_date]' ); ?>