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; ?>