Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Read-More-Button / Category in results › Reply To: Read-More-Button / Category in results
January 21, 2020 at 6:02 pm
#25378
Keymaster
Okay, I see the issue now. The post date field is not affected by those arguments, that might require a custom code. The post date field is __date, but the date format will do nothing there, it is for custom fields.
Instead of the variables in brackets, try using this string within the custom content field to mark the date:
||date||
Then a custom code will find, and process it.
Please try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_filter('asp_results', 'asp_filter_custom_date', 10, 1);
function asp_filter_custom_date( $results ) {
foreach ( $results as $k => &$r ) {
$date = date_i18n("d.m.y", strtotime($r->date));
$r->content = str_replace('||date||', $date, $r->content);
}
return $results;
}