custom fileds in the result

Home Forums Product Support Forums Ajax Search Pro for WordPress Support custom fileds in the result

This topic contains 2 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 5 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #19195

    I would like to know if it possible to have a custom field (date_from) in the result.
    I have event and I would like to show the date of the event in the result.
    here is the page…


    ok I find it.. but it’s a date in Timestamp; can i had something to transform it in Date

    Ernest Marcinko
    Ernest Marcinko


    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!

    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.