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;
}
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.