Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › custom fileds in the result › Reply To: custom fileds in the result
September 15, 2018 at 11:00 am
#19201
Keymaster
Hi!
To make that work, you will need a custom code to convert the timestamp to a visible date format. I have constructed a small snippet for you, which you can use in your theme functions.php file.
Try this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!
Change the following variables to your needs:
- $date_format -> This is parsed from wordpress, but you can use any date format string
- $field_name -> the custom field name
- $position -> use ‘before’ or ‘after’ depending if you want to display the date before or after the result content
- $prefix and $suffix -> to add text before and after the date field (including HTML)
I hope this helps!