Support

Account

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.