“Last Updated” Date to Post Meta Data [jalali date]
-
hi
i use this code to add the “Last Updated” Date to Post Meta Data
all thing is good but The date is Gregorian, but I want it to be solar [jalali] date
I set the date settings in WordPress to Iran but it did not workThanks for guiding me
// Add the “Last Updated” Date to Post Meta Data function et_last_modified_date_blog( $the_date ) { if ( 'post' === get_post_type() ) { $the_time = get_post_time( 'His' ); $the_modified = get_post_modified_time( 'His' ); $last_modified = sprintf( __( '?? ???????? ?? %s', 'Divi' ), esc_html( get_post_modified_time( 'j F, Y' ) ) ); $published = sprintf( __( '%s', 'Divi' ), esc_html( get_post_time( 'j F, Y' ) ) ); $date = $the_modified !== $the_time ? $last_modified . ' | ' . $published : $published; return $date; } } add_action( 'get_the_date', 'et_last_modified_date_blog' ); add_action( 'get_the_time', 'et_last_modified_date_blog' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘“Last Updated” Date to Post Meta Data [jalali date]’ is closed to new replies.