Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 3rd, 2012  |  syntax: PHP  |  size: 2.03 KB  |  views: 47  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2.   <?php
  3. //displays all users with their avatar and their posts (titles)
  4. $blogusers = get_users_of_blog();
  5. if ($blogusers) {
  6.   foreach ($blogusers as $bloguser) {
  7.     echo '<div class="content-slider-body">';
  8.         $user = get_userdata($bloguser->user_id);
  9.     echo '<div class="grid col-140">' . get_avatar( $user->ID, 128 ) . '</div>';
  10.     $args=array(
  11.       'author' => $user->ID,
  12.       'post_type' => 'post',
  13.       'post_status' => 'publish',
  14.       'posts_per_page' => 1,
  15.       'caller_get_posts'=> 1
  16.     );
  17.     $my_query = null;
  18.     $my_query = new WP_Query($args);
  19.     if( $my_query->have_posts() ) {
  20.       //echo 'List of Posts for ' . user->user_firstname . ' ' . $user->user_lastname;
  21.       while ($my_query->have_posts()) : $my_query->the_post(); ?>
  22.          
  23.                 <!-- post data -->
  24.                 <div class="grid col-300">
  25.                         <?php the_author_meta( 'author_status', $user->ID ); ?><br />
  26.                        
  27.                         Contact form pop-up with pre-filled name
  28.                 </div>
  29.                 <div class="grid col-460 ee-post fit"> 
  30.                                 <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4>
  31.                         <!--post-meta-->
  32.                         <div class="post-data"><span class="date"><?php the_time('F jS, Y') ?></span> by <?php the_author_posts_link(); ?>
  33.                                 <?php if ( comments_open() ) : ?>
  34.                                         <span class="comments-link">
  35.                                                 <?php comments_popup_link(__('Leave a Comment &darr;', 'responsive'), __('1 Comment &darr;', 'responsive'), __('% Comments &darr;', 'responsive')); ?>
  36.                                         </span>
  37.                                 <?php endif; ?>
  38.                         </div>
  39.                         <br /><?php the_excerpt(); ?>
  40.                         <!-- posted in categories -->
  41.                         <div class="posted-cats">
  42.                                 <?php printf(__('<span style="color: #003c8d;">Filed under</span>: %s', 'responsive'), get_the_category_list(', ')); ?>
  43.                         </div>
  44.                        
  45.                 </div>
  46.                 <!-- end post data -->
  47.    
  48.         <?php echo '<span class="rsTmb">' . $user->user_firstname . ' ' . $user->user_lastname . '</span></div>'; ?>
  49.                 <?php
  50.       endwhile;
  51.     }
  52.   wp_reset_query();  // Restore global post data stomped by the_post().
  53.   }
  54. }
  55. ?>
clone this paste RAW Paste Data