Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to set the loop for author posts.

  • Profile photo of enderpal444
    enderpal444
    Participant

    @enderpal444

    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)
  • Profile photo of modemlooper
    modemlooper
    Moderator

    @modemlooper

    <?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.
    
    
    Profile photo of enderpal444
    enderpal444
    Participant

    @enderpal444

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

    Profile photo of Landshark
    landshark
    Participant

    @landshark

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

    Profile photo of enderpal444
    enderpal444
    Participant

    @enderpal444

    Its called “bp posts on profile”

    Profile photo of enderpal444
    enderpal444
    Participant

    @enderpal444

    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