Home › Forums › Front-end Issues › group field in frontend page › Reply To: group field in frontend page
Thank you very much for your answer.
I had the problem that you were marking me with doing it through a short code, so I am doing it as a template.
I never did it this way, it marks me an error and I don’t know what it is.
In the loop I have the following:
<?php while ( have_posts() ) : the_post(); ?>
<?php if (is_user_logged_in() && current_user_can('cliente')) : ?>
<?php $current_user_id = get_current_user_id(); ?>
<?php $args = array(
'post_type' => 'clientes',
'author' => $current_user_id
); ?>
<?php $posts = get_posts($args); ?>
<?php if ($posts)
$post_id = $posts[0]->ID;
?>
: ?>
<?php endwhile; ?>
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.