Forums › Forums › Search & Filter Pro › Results markup & ACF fields customization
- This topic has 7 replies, 2 voices, and was last updated 4 years, 1 month ago by Trevor.
-
Anonymous(Private) October 19, 2020 at 5:26 pm #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!
TomasTrevor(Private) October 20, 2020 at 12:02 pm #263487To 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?
Trevor(Private) October 20, 2020 at 1:48 pm #263495In 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?
-
AuthorPosts