1
vote
Accepted
Different date time in results of search
All the date functions reference the global $post variable, but from your code the $post variable is not being used, so that's why the date is wrong.
Try this (untested):
foreach ( $total_results as $...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
loop × 3313wp-query × 725
custom-post-types × 520
php × 408
posts × 387
categories × 270
pagination × 212
custom-taxonomy × 193
query-posts × 192
theme-development × 161
query × 151
custom-field × 144
functions × 122
customization × 118
pages × 100
templates × 94
advanced-custom-fields × 84
get-posts × 76
plugins × 69
taxonomy × 65
ajax × 63
woocommerce-offtopic × 62
filters × 61
shortcode × 61
page-template × 61