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->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!
© 2022 Advanced Custom Fields.