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 still may not be clear on where this field is, but there is a loop on the search results page that shows the results of the search, or there should be.
if (have_posts()) {
while (have_posts()) {
the_post();
// this will get the field object on the current posts
get_field_object('language');
}
}
If you’re trying to show the entire search results in different languages, I’m not sure I can be much help with the displaying of languages but I’d create an options page where I could add option values for pages that do not have an editor. Then I’d get that option value and use it instead of a field on a particular post.
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.