Forums › Forums › Search & Filter Pro › Search & Filter Pro with an ACF Custom Post Type
- This topic has 15 replies, 2 voices, and was last updated 5 years, 3 months ago by
Trevor.
-
Trevor(Private) July 2, 2020 at 5:21 pm #251221
ACF Custom fields are found in the Form UI. Add a ‘Post Meta’ object to the form, and then select the meta key name from the list. Make sure the name does NOT start with an underscore, it will appear a second time on the list without the underscore. Also select the ‘Is an ACF field’ option.
Anonymous(Private) July 4, 2020 at 8:31 pm #251396Last question, display the results with my ACF custom fields (logo, type of client, and name) won’t work with shortcodes ?
I displayed the result with shortcodes, filters are working, but the result only show the name of the client.
Is there a specific display result method for ACF ?Trevor(Private) July 6, 2020 at 11:29 am #251450You want to display the content of these fields in the results? If you are using the Shortcode display results method then you need to follow the customising guide here:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
There are elements that you do not need, so you can delete those. For ACF fields, you can output the contents of the fields to the page using PHP code like this (the example is for a field named
test_price):$test_price = get_field('test_price'); if( $test_price ) echo $test_price;Your actual PHP may need to add HTML around what is echoed to the page.
Trevor(Private) July 6, 2020 at 3:19 pm #251538Are you able to send me a live link/URL to your search page so I can take a look?
Can you show me one or more annotated screenshot(s) of the design change(s) you want? If you can do that, you would need to upload the screenshot image(s) to a file sharing site (like the WordPress Cloudup site) and share the link with me?
Anonymous(Private) July 7, 2020 at 3:44 pm #251819Hi, I’m currently working on a local server so I won’t be able to send you a link right now but the website will be online tomorrow or on thursday so I’ll be back to you soon with the url. For now, here’s the design I need for the filters : https://zupimages.net/viewer.php?id=20/28/6hfv.png
Thank you for the results page, it worked great !
Trevor(Private) July 8, 2020 at 3:22 pm #252024I switched off the settings for Relevance because you do not have a search box in the form, and you need the Relevanssi plugin for these to work anyway.
I switched ON the Auto Cont settings, and also Hide Empty in each field. Now only options that have posts attached will actually show. Unused options will not show.
Also, I switched the display of counts on each for testing.
You are searching the Références post type, yes?
For me, the search works.
-
AuthorPosts