I’ve added a custom field to the wp user profile page to hold an image.
the image in acf returns the object
and when I call it in a template everything works great.
I cannot get the image to display in the search results page
here’s my snippet.
I call the featured image of posts, then I try calling to see if the user image exists…but thats part of the problem and then if no featured or user image then show the no logo image.
Thank you for taking the time to help me with my problem
I tried what you suggested, iremoved the global $post and for both variables, author_badge and author_id
Both returned empty or blank.
I then did a var_dump on them
and for author_id the result was string(0) “”
and for author_badge the result was bool(false)
I use the same code on a static template outside the loop and it works as expected.
Is it because Im in the wp loop of trying to access acf custom user data?