Forums › Forums › Search & Filter Pro › ACF and CPT output
- This topic has 5 replies, 2 voices, and was last updated 8 years, 1 month ago by Trevor.
-
Anonymous(Private) October 10, 2016 at 9:42 pm #63185
I have custom fields from ACF and custom post types in CPT, and all this does is show a linked title with author information. How can I theme the output to include the custom fields?
I have checked the documentation, but it doesn’t describe how to build a template using ‘the loop’Anonymous(Private) October 11, 2016 at 2:38 pm #63289I was using the slug, but it only output titles and author info. I am trying to access custom fields and wrap them for the output, but I don’t see any code examples on
https://www.designsandcode.com/documentation/search-filter-pro/search-results/as-an-archive/
I am using the Avada themeTrevor(Private) October 11, 2016 at 3:12 pm #63303Using templates from your theme, as Post Type Archive and As an Archive methods do, means you have to edit the template files and add the php yourself. ACF has examples on its own site.
If you use the Shortcode method, then that uses our own results.php template (you make a copy for your theme) and then it is easy for me to show you how, if I haven’t already posted examples for Avada users (do a quick search for
avada results.php
).Anonymous(Private) October 11, 2016 at 10:44 pm #63425I got my results themed by altering the plugins/search-filter-pro/templates/results.php file, but this is not ideal. I have created mythemename/search-filter-pro/templates/results.php and mythemename/search-filter/templates/results.php but neither of these is being loaded.
If you have a url where any of this is explained, it would be appreciated.
In the meantime, I did get a custom field, named location, wrapped by adding this to results.php in the plugin folder:
<div class="customtest"><?php the_field('location'); ?></div>
-
AuthorPosts