Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Author Posts in Profile Page

@peter-hamilton

Participant

Hi, first off all, hanks for sharing @azchipka‘s code, i have been looking for that function myself.

I found a way to adjust the code to what you need

function profile_screen_posts_show() {
query_posts( 'author=' . bp_displayed_user_id() );
	if ( have_posts() ) : ?>
<div class="category-wrap" style="width:100%;">
<ul class="two-post-wrap">

<?php // Start the Loop.
	while ( have_posts() ) : the_post(); 

	/*
	* Include the Post-Format-specific template for the content.
	* If you want to override this in a child theme, then include a file
	* called content-___.php (where ___ is the Post Format name) and that will be used instead.
	*/ ?>
<li>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_post_thumbnail(); ?>
 <?php the_excerpt();?></span>
</li>

<?php // End the loop.

endwhile; ?></ul></div>
	<?php else:?>
	<div id="message" class="info">
		<p><?php bp_displayed_user_username(); ?> has not published any post! </p>
	</div>
    <?php endif; ?>    <?php

}

//POSTS ON PROFILE ENDS HERE

?>

You can remove thumbs, excerpt if you like, and/or add css classes.

I used this code here on my site

Changed posts to articles and working like a charm

Thanks again

Skip to toolbar