In my search.php file i have a loop which succesfuly gives list of search query.
global $wp_query;
$total_results = $wp_query->posts;
if ( $total_results ) :
foreach ( $total_results as $tr ) :
//(...)
endforeach;
endif;
But there is something wrong with date time in results because the_time()
function displays a wrong date for all listed posts. Here is what i get:
the_time( 'j F Y, G:i' ); // --> 7 NOVEMBER 2023, 20:00 (don't know what kind a date is that)
echo get_the_date( 'j F Y, G:i' ); --> 7 NOVEMBER 2023, 20:00
echo $tr->post_date; // --> 2023-10-13 23:00:47 (proper publish date)
Is my query is right? Apart from date, meta data of all listed posts are correct (title, author etc.).