Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Show member recent post in members loop

@applegateian

Participant

@henrywright-1 that works!

I need to show the featured image, and link to the profile, so I added the following, but it’s just pasting the image URL, how do I add img src to that and the link to the post?

<?php
    $user_id = bp_get_member_user_id(); 
    $query = new WP_Query( 'author=' . $user_id );

    if ( $query->have_posts() ) {
        while ( $query->have_posts() ) {
            $query->the_post();
            //display title
            the_title();
            //display content
            the_content();
            //featured image
            the_field('featuredimage');
        }
    }

//reset for next member
wp_reset_postdata();
?>
Skip to toolbar