Forums Forums Search & Filter Pro Search within ACF text-area content

Tagged: ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #53435

    Hi – Just purchased Search & Filter Pro.

    Trying to use it on a reasonably well established gardening site. We’re creating a new section ‘Questions and Answers’.

    All the posts within this section belong to their own custom post type (QandA).
    So far so good, I can get Search & Filter to search within the CPT without any problem.

    However we are also using ACF (advanced custom fields pro) extensively across the site. Within the QandA posttype we’re using ACF for the ‘Answer’ (an ACF text-area field). The standard post content ( ‘the_content()’ ) is used just for the ‘Question’.

    Search & Filter pro appears to search and display results from the standard wordpress content field, but how do I get it to also search, cache and display content from the ACF text-area field within each post?

    I can find many posts in your forum about using ACF for filter options, but nothing about actually searching and displaying ACF custom field text.

    Oh, also how do I modify the search results to show the ACF text-field content too?

    Many thanks!
    Stef

    Trevor
    #53440

    Let us address one question at a time. You need to install the free plugin called Relevanssi and in the S&F Pro form Advanced tab enable support for it. In the Relevanssi settings there is a single setting field for custom meta fields, where you need to enter the value all and the build the index.

    If you are using the shortcode method, then you need to customize the results.php file, as per the documentation:

    http://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results

    And then use the ACF Pro documentation to output the ACF field values in your results.php file.

    Anonymous
    #53441

    Awesome – thanks for your help and quick reply Trevor.

    Actually just found most of the info I needed when you answered someone else’s post here: https://support.searchandfilter.com/forums/topic/cant-get-search-by-keyword-to-work/#post-52981

    Sorry, should have searched harder.

    Thanks for you link to the relevant part in the docs about customising results.php. I was about to ask how to modify that file without loosing my tweaks when updating plugin. I’d already looked in the docs but missed that bit, so thanks. Wonder if it’d be worth adding to or creating a section called templates…

    Anyhow, many thanks for plugin and your help.

    Kind regards
    Stef

    Trevor
    #53446

    Can I close this thread and mark it resolved?

    Anonymous
    #53447

    Yes, please do.
    Thanks for your time.
    S

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