Loop Only Showing Primary Author’s Posts
-
I wrote a loop to display the posts assigned to the currently logged in user. However with this plugin, the loop only returns posts where the current user is the primary author. For example, if I assign two authors to one post, the second Author returns no posts. I confirmed this by changing the order of Authors using the plugin drag+drop interface.
Here’s my loop:
<ul> <?php if ( is_user_logged_in() ): global $current_user; get_currentuserinfo(); $author_query = array('posts_per_page' => '-1','author' => $current_user->ID,'post_type' => 'residents'); $author_posts = new WP_Query($author_query); while($author_posts->have_posts()) : $author_posts->the_post(); ?> <li><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li> <?php endwhile; else : echo "not logged in"; endif; ?> </ul>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Loop Only Showing Primary Author’s Posts’ is closed to new replies.