Results markup & ACF fields customization

Forums › Forums › Search & Filter Pro › Results markup & ACF fields customization

Tagged: , ,

Viewing 8 posts – 1 through 8 (of 8 total)
  • Anonymous
    #263422

    Hello! I have just bought your great plugin! 🙂

    Many things is clear to me. However I did not find the way how to customize which information is shown in the search results.

    I am filtering CPT with several ACF fields and I would like to know, whether I can decide which fields will be shown and also how to add a custom markup around them.

    Also good to mention – I am using Gutenberg and the search section is placed among other sections on the page. Am I right, that the only way how to show S&F results in this case will be the shortcode? Or would this be doable with a custom template somehow?

    Thank you very much in advance!
    Tomas

    Trevor
    #263452
    This reply has been marked as private.
    Anonymous
    #263472
    This reply has been marked as private.
    Trevor
    #263487

    To display an ACF field (make sure you get the field name right in our plugin, they do NOT start with an underscore), code like this:

    $perex = get_field('perex');
    if( $perex ) echo $perex;

    Of course, you might put some HTML around that, not might want something else if no value found …

    As to the taxonomies, would they have single or multiple terms per post?

    Anonymous
    #263492
    This reply has been marked as private.
    Trevor
    #263495

    In that you may want to display data from custom fields and taxonomies, the shortcode method is probably best. We are working on alternatives, but for now I think this is the way for you.

    When using the Shortcode display results method, it uses a template file named results.php. You would need to customize that, as per this starter guide:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results

    Is that what you needed to know?

    Anonymous
    #263620

    Ah, I don’t know how I could overlooked this part of documentation, but that’s exactly I was searching for! 🙂 Thank you!

    Trevor
    #263623

    Thanks for getting back to me. I will close this thread for now.

Viewing 8 posts – 1 through 8 (of 8 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.