Home › Forums › General Issues › Get a field object outside of the post context › Reply To: Get a field object outside of the post context
I thought that you only wanted to show the actual values that were used, not all the choices. Sorry, I may have given you a solution that was not what you were looking for.
If you want to do this you can do it with ACF, but like you said in the first post you need to supply a post ID. This can be overcome by using the ID of the first post in the results.
get_field_object('language', $wp_query->posts[0]->ID);
But this will only work if there are results to be shown.
It can also be done using the field key instead of the field name. This is explained in the documentation for get_field_object() http://www.advancedcustomfields.com/resources/get_field_object/
get_field_object('field_1234567890123');
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.