Forums › Forums › Search & Filter Pro › Search Results With CPT & ACF fields
- This topic has 8 replies, 2 voices, and was last updated 4 years, 7 months ago by Trevor.
Viewing 9 posts - 1 through 9 (of 9 total)
-
Anonymous(Private) May 19, 2020 at 4:28 pm #244930
Hi, I have a custom post type and I’m using ACF with that CPT. I need to create dropdown search based on one of the fields (county) that returns all the ACF fields associated. Can this be done with a shortcode or do I need to create a custom archive template with a custom loop? I tried to look through the documentation and the forum but was having trouble finding relevant info.
Thanks!
Trevor(Private) May 20, 2020 at 2:10 pm #245136This is what I see. To get the fields to show in the results you would need to code them into the template, using this guide:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
The extra code would likely need to look like this:
<?php $county = get_field('county'); if( $county ) { ?> <div class="county-field">County: <?php echo $county; ?></div> <?php } ?>
-
AuthorPosts
Viewing 9 posts - 1 through 9 (of 9 total)