• Resolved gigcity

    (@gigcity)


    I have created a new user field called picture but am having trouble referencing it. I’m using the following code to generate that page:

    function rca_list_authors() {
    
    	$authors = wp_list_authors(array(
        'orderby'       => 'post_count', 
        'order'         => 'DESC', 
        'number'        => null,
        'optioncount'   => true, 
        'exclude_admin' => false, 
        'show_fullname' => true,
        'hide_empty'    => true,
        'echo'          => true,
        'style'         => 'list',
        'html'          => true
    	)
    );
    	
    $list = '';
     
    if($authors) :
    
    		$list .= '<div class="author-list">';
    
    foreach($authors as $author) :
     
    	$list .= '<div class="author">';
     
    		$archive_url = get_author_posts_url($author->ID);
    		$archive_photo = get_avatar($author->ID, 120);
     
    		$list .= '<p>'  . $archive_photo . '</p>';
    
    		$list .= get_wp_user_avatar($author->ID, '120');
    		$list .= '<a href="'. $archive_url . '">' . $author->display_name . '</a>';
    		$list .= '<p class="author-bio>' . get_user_meta($author->ID, 'description', true) . '</p>';
    		$list .= '<p class="author-archive"><a href="'. $archive_url . '" title="' . __('View all posts by ', 'pippin') . $author->display_name . '">' . __('View author\'s posts', 'pippin') . '</a></p>';
    		$list .= '<p>'  . $author->optioncount . '</p>';	
    	$list .= '</div>';
     
    endforeach;
    	$list .= '</div>';		
     
    endif;
     
    return $list;
    
    }
    
    add_shortcode('rca_authors', 'rca_list_authors');

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Help pulling a User Custom Field’ is closed to new replies.