Forums Forums Search & Filter Pro ACF and CPT output

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #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’

    Trevor
    #63208

    Hi Arne

    Which Display results method are you using for the form?

    Anonymous
    #63289

    I 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 theme

    Trevor
    #63303

    Using 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
    #63425

    I 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>

    Trevor
    #63450

    mythemename/search-filter/templates/results.php

    should be

    mythemename/search-filter/results.php

    The other (mythemename/search-filter-pro/templates/results.php) is simply wrong and would not be used. It is covered in the documentation here:

    https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results

Viewing 6 posts - 1 through 6 (of 6 total)