How to Change Date Format in the Blog Post

If you don't want the format of the date in your blog post you can easily change that with the format of your choice.

Go over your files in your FTP server and edit template-tags.php (Path: \wp-content\themes\instaportfoliopro\inc\template-tags.php)

(M - Month, j - Date, Y - Year)

Look for the code below:

$time_string = '<i class="icon-calendar"></i> ' . sprintf( $time_string,
esc_attr( get_the_date( 'M j, Y' ) ),
esc_html( get_the_date( 'M j, Y' ) ),
esc_attr( get_the_modified_date( 'M j, Y' ) ),
esc_html( get_the_modified_date( 'M j, Y' ) )

Replace the code above with your updated code.  Use the code below to put your chosen date format.

Once you locate the code, replace the above code with this one:
$time_string = '<i class="icon-calendar"></i> ' . sprintf( $time_string,
esc_attr( get_the_date( 'Your Date Format' ) ), /*esc_attr( get_the_date( 'M j, Y' ) ),*/
esc_html( get_the_date( 'Your Date Format' ) ),
esc_attr( get_the_modified_date( 'Your Date Format' ) ),
esc_html( get_the_modified_date( 'Your Date Format' ) )

 

 

Have more questions? Submit a request