This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

custom fileds in the result

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

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

    Hi
    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…

    https://business365.net/saint-martin/event/

    #19197
    BLUECONCEPTBLUECONCEPT
    Participant

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

    #19201
    Ernest MarcinkoErnest Marcinko
    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!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.