Advertisement
Guest User

function wassimo realted

a guest
Mar 24th, 2012
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. <?php
  2.  
  3. //get all users, iterate through users, query for one post for the user,
  4. //if there is a post then display the post title, author, content info
  5. $blogusersz =  get_users();
  6.   $the_authord= get_the_author_ID();
  7. if ($blogusersz) {
  8.   foreach ($blogusersz as $bloguser) {
  9.     $argsz = array(
  10.     'author' => $the_authord,
  11.       'showposts' => 1,
  12.       'orderby' => rand,
  13.       'caller_get_posts' => 1
  14.     );
  15.     $my_queryzz = new WP_Query($argsz);
  16.     if( $my_queryzz->have_posts() ) {
  17.       // $user = get_userdata($bloguser->user_id);
  18.       // echo 'This is one post for author with User ID: ' . $user->ID . ' ' . $user->user_firstname . ' ' . $user->user_lastname;
  19.       while ($my_queryzz->have_posts()) : $my_queryzz->the_post(); ?>
  20.         <a style="margin:7px;" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php  the_post_thumbnail( array(50,50) ); ?></a>
  21. <?php
  22.       endwhile;
  23.     }
  24.   }
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement