I resolve with:
<?php
$args = array (
'role' => 'contributor',
'order' => 'ASC',
'orderby' => 'display_name',
);
// Create the WP_User_Query object
$wp_user_query = new WP_User_Query($args);
// Get the results
$authors = $wp_user_query->get_results();
// Check for results
if (!empty($authors)) {
echo '<div class="row">';
// loop through each author
foreach ($authors as $author)
{
// get all the user's data
$author_info = get_userdata($author->ID);
$image = get_field('image','user_' . $author->ID );
echo '<div class="col-md-3">
<ul class="list_detail">
<li> ' . $author_info->first_name . '
' . $author_info->last_name . '</li>
<li> ' . $author_info->settore . '</li>
<li> ' . $author_info->citta . '</li>
<li> <img src="' . $image['url'] . '" /> </li>
<li> ' . $author_info->cellulare .' </li> </div>';
}
echo '</div>';
} else {
echo 'No authors found';
}
?>
yes..i try this too. but same problem.
<?php
$args = array (
'role' => 'contributor',
'order' => 'ASC',
'orderby' => 'display_name',
);
// Create the WP_User_Query object
$wp_user_query = new WP_User_Query($args);
// Get the results
$authors = $wp_user_query->get_results();
// Check for results
if (!empty($authors)) {
echo '<div class="row">';
// loop through each author
foreach ($authors as $author)
{
// get all the user's data
$author_info = get_userdata($author->ID);
$image = get_field('image','user_' . $author->ID);
echo '<div class="col-md-3">
<ul class="list_detail">
<li> ' . $author_info->first_name . '
' . $author_info->last_name . '</li>
<li> ' . $author_info->settore . '</li>
<li> ' . $author_info->citta . '</li>
<li> <img src=" ' . $image . ' " /> </li>
<li> ' . $author_info->cellulare .' </li> </div>';
}
echo '</div>';
} else {
echo 'No authors found';
}
?>
Hi, i try to use this your solutions but ech is “null”
I try to use one example find in this forum, but i have problem.
I attach all screenshot in order.
This is code i add in php
<ul class=”nav nav-tabs” role=”tablist”>
<li role=”presentation” class=”active”>Home
<?php if ( have_rows(‘repeater’, ‘option’) ) {
while ( have_rows(‘repeater’, ‘option’) ) : the_row();
$image = get_sub_field(‘repeater_subfield1’, ‘option’ );
endwhile;
if($image) {
?>
<li role=”presentation”>Profile
<?php } } ?>
<!– Tab panes –>
<div class=”tab-content”>
<div role=”tabpanel” class=”tab-pane active” id=”home”>Home Text</div>
<div role=”tabpanel” class=”tab-pane” id=”profile”>
<?php while ( have_rows(‘repeater’, ‘option’) ) : the_row(); ?>
<div class=”col-sm-2 col-xs-6 color_showcase text-center”>
” alt=””>
<?php the_sub_field(‘repeater_subfield2’); ?>
</div>
<?php endwhile; ?>
</div>
</div>
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.