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

Custom field values in Horizontal Results

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Custom field values in Horizontal Results

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #21728
    donlangedonlange
    Participant

    Hello Ernest,

    Is there a way to include a meta data meta_value in the Horizontal Results?

    For example included the property price in the New Listings section on the:

    https://chasebrothersland.com home page?

    Thank you for your support,
    Don

    #21738
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Don,

    Sure, it works the same way as the vertical results. For more information, check the advanced title and content fields documentation.

    #21755
    donlangedonlange
    Participant

    That’s a cool feature, Ernest.

    However, at what point can I run the meta_value through the PHP number_format() function so I can display these 7+ digit prices with commas as I have done in my WordPress template file?

    Thank you,
    Don

    #21758
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Don,

    Well, it’s not possible to do that via that feature. You will need a custom code instead. There is knowledge base article here on how to do that.
    The number format code should be placed below this line in that code:

    if ( !empty($meta_value) ) {

    ..something like:

    if ( !empty($meta_value) ) {
        $meta_value = number_format($meta_value);
    #21761
    donlangedonlange
    Participant

    Thank you, Ernest… that did the trick!

    Regards,
    Don

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