a4270407 by Jeff Balicki

date

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent 141e18fd
......@@ -257,4 +257,31 @@ if ( ! function_exists( 'understrap_all_excerpts_get_more_link' ) ) {
}
}
add_filter( 'excerpt_length', function( $length ) { return 35; } );
\ No newline at end of file
add_filter( 'excerpt_length', function( $length ) { return 35; } );
function wpmldp_translate_date_format( $date ) {
//Create array with dates
$month_dates = array();
$month_dates[] = '1st';
$month_dates[] = '2nd';
$month_dates[] = '3rd';
for($d=4; $d<=30; $d++) {
$month_dates[] = $d.'th';
}
$month_dates[] = '31st';
//Register strings on String Translator
foreach( $month_dates as $month_date ) {
do_action( 'wpml_register_single_string', 'Date Formats', 'Month Date (WPML) - '.$month_date, $month_date);
}
//Translate strings
if( in_array($date, $month_dates) ) {
$date = apply_filters( 'wpml_translate_single_string', $date, 'Date Formats', 'Month Date (WPML) - '.$date);
}
return $date;
}
add_filter( 'wp_date', 'wpmldp_translate_date_format', 10, 1 );
\ No newline at end of file
......
......@@ -60,8 +60,8 @@ function pull_posts_for_post_list( $data ) {
if(!$img) {
$img = get_post_meta($post->ID, 'photo_from_source', true);
}
error_log($excerpt);
$new_posts[] = ['date'=>get_the_time( ' F j, Y', $post),
$new_posts[] = ['date'=>wp_date( ' F j, Y', get_post_timestamp($post->ID)),
'article_author'=>$article_author,'author_title'=>$author_title,
'author_company'=>$author_company,'href'=>get_permalink($post),'title'=>$post->post_title,
'text'=>$excerpt,'img_src'=>$img];
......@@ -116,7 +116,7 @@ function pull_posts_for_post_list( $data ) {
if(!$img) {
$img = get_post_meta($post->ID, 'photo_from_source', true);
}
$posts[] = ['date'=>get_the_time( ' F j, Y', $post),
$posts[] = ['date'=>wp_date( ' F j, Y', get_post_timestamp($post->ID)),
'article_author'=>$article_author,'author_title'=>$author_title,
'author_company'=>$author_company,'href'=>get_permalink($post),'title'=>$post->post_title,
'text'=>$excerpt,'img_src'=>$img];
......