How to display published date for blog post

If your posts are displaying the date of creation or modification, but you want to set the specific date for publication your post, then you need to do next:

1. Copy this function and insert into functions.php  file of your child theme

function seosight_posted_time( $icon = true){

$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';

 

$time_string = sprintf( $time_string,

esc_attr( get_the_date( 'c' ) ),

esc_html( get_the_date() )

);

 

$icon_html = (true === $icon) ? '<i class="seoicon-clock"></i>' : '';

 

return sprintf(

'<span class="post__date">' . $icon_html . $time_string . '</span>'

);

}

2. Then you can change any date for the post in the editor.