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…
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
Thanks cabrailsford, it worked like a charm.