Forums › Forums › Search & Filter Pro › Search within ACF text-area content
- This topic has 4 replies, 2 voices, and was last updated 8 years, 4 months ago by Anonymous.
-
Anonymous(Private) August 4, 2016 at 2:51 pm #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!
StefTrevor(Private) August 4, 2016 at 3:04 pm #53440Let 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:
And then use the ACF Pro documentation to output the ACF field values in your results.php file.
Anonymous(Private) August 4, 2016 at 3:30 pm #53441Awesome – 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 -
AuthorPosts