• Hi, I would like to create a page in which all the authors name and their bio with their profile pictures should be listed.

    how to do this ?

    P.S I am a beginner to wordpress.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You can list them using these functions:
    get_users()
    get_avatar()

    For example :

    <ul>
    <?php
    $blogulist = get_users();
    foreach ($blogulist as $blogus){
        $uav       = get_avatar($blogus->ID,30,'',$blogus->display_name);
    	$upostsurl = get_author_posts_url($blogus->ID);
        echo '<li><a href="'.$upostsurl.'">'.$uav.$blogus->display_name.'</a></li>';
    }
    ?>
    </ul>
    Thread Starter Cupidf007

    (@cupidf007)

    Sorry i dont knw about the coding stuff!! where i have to put this code. I tried by creating author.php and used this code but no use.

    The code works just place it where You want to display the list of users in your theme templates.
    For example, place this in the author.php file of twentyeleven theme
    just above this part: </div><!-- #content -->

    <ul>
    <h3>Browse other authors' posts</h3>
    <?php
    $blogulist = get_users();
    foreach ($blogulist as $blogus){
        $uav       = get_avatar($blogus->ID,30,'',$blogus->display_name);
    	$upostsurl = get_author_posts_url($blogus->ID);
        echo '<li><a href="'.$upostsurl.'">'.$uav.$blogus->display_name.'</a></li>';
    }
    
    ?>
    </ul>

    Hi Dawn birth,

    With the code provided how do I block certain authors from showing up? I’m guess using their ID’s but I dont get how to do it.

    Anyways,
    Thank you

    Yes, U can do this depending on their IDs
    Put the IDs which U want to hide in an array, and skip the users in this array from the loop.

    So the previous code will be like this:

    <ul>
    <h3>Browse other authors' posts</h3>
    <?php
    $blogulist = get_users();
    $hide_users = array(1,7,12);
    foreach ($blogulist as $blogus){
        if(in_array($blogus->ID,$hide_users)){continue;}
        $uav       = get_avatar($blogus->ID,30,'',$blogus->display_name);
    	$upostsurl = get_author_posts_url($blogus->ID);
        echo '<li><a href="'.$upostsurl.'">'.$uav.$blogus->display_name.'</a></li>';
    }
    
    ?>
    </ul>

    in this part:$hide_users = array(1,7,12);
    the users with these IDs :”1,7,12″ will be hidden from the list.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Authors Page’ is closed to new replies.