Support

Account

Home Forums Backend Issues (wp-admin) How do you access a User ACF field from a Post Query? Reply To: How do you access a User ACF field from a Post Query?

  • You cannot use data like this in elementor.

    You are trying to get the value of something based on the value of something else. As far as I know you cannot put PHP code into an elementor field. This requires creating a shortcode.

    An example shortcode based on the above

    
    add_shortcode('my_shortcode_name', 'my_shortcode_name_callback');
    my_shortcode_name_callback($atts=array, $content='') {
      global $post();
      $user = get_field('user_field', $post->ID);
      $user_content = get_field('company_name', $user);
      return $user_content;
    }