Support

Account

Home Forums ACF PRO Display Custom Fields in Search Results

Solved

Display Custom Fields in Search Results

  • I’m trying to simply display one or two custom fields for each post that is returned in any given search query.

    I’m not trying to search via custom fields, but rather just display them in the results. But I can’t get it to work.

    In my search results loop I tried the usual get_field('county'); with no luck, so I tried get_field('county', $post->ID); and that didn’t work either…

    Any thoughts?

    Thanks!

  • Have you tried using the_field('county'); instead? Because if you’re just using get_field(), it won’t display your results without writing it as echo get_field('county');

  • Well, hot-dog!

    Thanks cabrailsford, it worked like a charm.

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

The topic ‘Display Custom Fields in Search Results’ is closed to new replies.