Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $authors = $wpdb->get_results( $wpdb->prepare("SELECT ID, user_nicename from $wpdb->users WHERE 1=1 ORDER BY display_name") );
- if ( $authors ) {
- foreach ( $authors as $author ) {
- $user = get_userdata($author->ID);
- $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 get_avatar( $user->ID, 46 ); //opcional
- echo '<h2>Posts de ' . $user->user_firstname . ' ' . $user->user_lastname . '</h2>';
- echo '<ul>';
- while ($my_query->have_posts()) : $my_query->the_post();
- echo '<li><a href="'. get_permalink() .'" rel="bookmark" title="Permanent Link to '. the_title_attribute('echo=0') .'">'. get_the_title(). '</a></li>';
- endwhile;
- echo '</ul>';
- }
- wp_reset_query();
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement