Buddypress social query_posts by displayed_user

In a custom user tab I’m trying to display that users posts. (displayed user, not logged in user).

I found this code on a forum but it’s not working for me. It should pull the ‘displayed users’ posts only, instead it shows all posts. How Can I make it pull only posts by the “displayed user”?

query_posts( 'author=' . $bp->displayed_user->id );

// the Loop
while (have_posts()) : the_post();
the_content( 'Read the full post »' );
endwhile;

What am I doing wrong?

Thanks a ton!

  • Kimberly
    • Champion of Loops

    Hi Eric!

    Using this

    <?php the_author_posts_link(); ?>

    in your post template file (single.php usually) will show the list of the users posts when clicked.

    Is this in the neighborhood of what you were looking for?

    Perhaps I can help you to create a child theme to implement?

    Best,

    Kimberly

  • ericslangley
    • The Incredible Code Injector

    @KimberlyL appreciate your reply.

    That's not quite what I'm looking for. I don't need to display a list the authors post. Rather I need to display a single post or page by the displayed member.

    For example, I click on any member and open up a custom tab I created under their name called "style". In that style tab I want to display that member's single post. That post would be tagged "disc". So that way I'm only pulling that one specific post.

    Does that clear up what I'm trying to do?

    Thanks!

  • PC
    • WPMU DEV Initiate

    Greetings ericslangley,

    Did you happen to try the suggestion provided by Kim ? If that sorted out the problem, its great, no need to post back. I am gonna mark this post as resolved as we have not heard back from you on this.

    Should you still have any issues, please feel free to post it here and re-open the thread by selecting not- resolved so that the ticket will show up again in our ticketing system :slight_smile:

    Thanks for being a great WPMUDEV Member !

    Cheers
    PC

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.