Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //displays all users with their avatar and their posts (titles)
- $blogusers = get_users_of_blog();
- if ($blogusers) {
- foreach ($blogusers as $bloguser) {
- echo '<div class="content-slider-body">';
- $user = get_userdata($bloguser->user_id);
- echo get_avatar( $user->ID, 64 );
- $args=array(
- 'author' => $user->ID,
- 'post_type' => 'post',
- 'post_status' => 'publish',
- 'posts_per_page' => 1,
- 'caller_get_posts'=> 1
- );
- $my_query = null;
- $my_query = new WP_Query($args);
- if( $my_query->have_posts() ) {
- //echo 'List of Posts for ' . user->user_firstname . ' ' . $user->user_lastname;
- while ($my_query->have_posts()) : $my_query->the_post(); ?>
- <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a><br /><?php the_excerpt(); ?></p>
- <?php echo '<span class="rsTmb">' . $user->user_firstname . ' ' . $user->user_lastname . '</span>'; ?>
- </div>
- <?php
- endwhile;
- }
- wp_reset_query(); // Restore global post data stomped by the_post().
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement