Home › Forums › Front-end Issues › Trying to get property of non-object (ACF 5.8.5) › Reply To: Trying to get property of non-object (ACF 5.8.5)
This kind of error is very common but not specific to ACF. You’re trying to echo $term->name
, and the error says it can’t find name
. So take a step back and see what WordPress has actually put into your $term
by dumping it. You can’t echo every type of var, but you can print_r()
it. Do a print_r( $term );
and go from there. It may be empty, it may be a string, array, object. Lots of possibilities.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.