Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to set the loop for author posts.

  • @enderpal444

    Participant

    Im trying to add a loop to authors profiles to show their latest posts and I’m wondering how you set the query string so that it pulls that authors posts. I can’t find how to do this anywhere. Just a plugin but I want to create my own loop for the sidebar.

Viewing 5 replies - 1 through 5 (of 5 total)
  • @modemlooper

    Moderator
    <?php
    global $bp;
    $user_id = $bp->displayed_user->id;
    query_posts($query_string . '&author='. $user_id);
    ?>
    
    <h2><a href=&quot;" rel="bookmark" title="Permanent Link to "></a></h2>
    
    <div class="entry">
    
    </div>
    
    Sorry, no posts matched your criteria.
    
    

    @enderpal444

    Participant

    Thx so much that’s perfect. Im using your Citizen Kane to build a really cool site. Thx for all your contributions!

    @landshark

    Participant

    @enderpal444 you mentioned there is a plugin for this I assume to get it in a users profile?

    @enderpal444

    Participant

    Its called “bp posts on profile”

    @enderpal444

    Participant

    How can I list the the post count at the top of the loop for each author?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to set the loop for author posts.’ is closed to new replies.
Skip to toolbar