List user with button radio loop with acf

Question

I need to create a ratio button (that’s ok) in the backoffice users. .. (that’s ok). When a user creates a new user he must click on this ratio button (yes I am a scientific manager or not I am not). And if he clicks yes, in an archive page that I created with a template page, the list of desired information appears as well as his name, first name. But I can’t get my code to work with a condition. Do you see if anything is missing?

enter code here function comite_shortcode_science($atts){
$contributor_member = array(
    'orderby' => 'user_nicename',
    'order' => 'ASC',
);
ob_start();
$authors = get_users($contributor_member);
foreach ($authors as $users):
    if( get_field('chef_user_science') == 'oui' ) {
        echo '<div class="column-member">';
        echo '<div class="info-member">';
        echo '<span class="comite-description-name"><a href=' . get_author_posts_url($users->ID) . '>' . $users->display_name . '</a></span>';
        echo '<span class="comite-description">' . $users->institution_rattachementUser . '</span>';
        echo '<span class="comite-description">' . $users->fonctionUser . '</span>';
        echo '</div>';
        echo '<div class="button-member">';
        echo '<a href=' . get_author_posts_url($users->ID) . '>En savoir plus</a>';
        echo '</div>';
        echo '</div>';
        echo '<hr class="separator-member">';
    }
endforeach;
$short_list = ob_get_clean();;
return $short_list;}add_shortcode('comite_science', 'comite_shortcode_science');
0
Dim 2 months 0 Answers 8 views 0

Leave an answer