Support

Account

Home Forums General Issues Image field in admin section Reply To: Image field in admin section

  • 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';
    }
    ?>