Quantcast
Channel: bbPress.org » All Posts
Viewing all articles
Browse latest Browse all 3685

Reply To: Display post count in sidebar for author ID

$
0
0

Suspect that you ID bit isn’t working, hence you’re getting zeros

I use a count code to put a total count after the avatar using

function display_counts () 
{
		$post_count = bbp_get_user_post_count( bbp_get_reply_author_id( $reply_id )) ;
		echo "<br>Total posts : " ;
		echo $post_count ;
		echo "</br>" ;

		}
add_action ('bbp_theme_after_reply_author_details', 'display_counts') ;

and that works fine.

If you doing this for the topic, then $reply_id might be worth having a go at, depends on whether the widget is doing this for the topic, or the last reply !

Otherwise you might need to actually specify an ID (the codex talks about needing to do this if outside the loop, and your widget would not be displayed within the loop eg as in

get_the_author_meta(‘ID’,$ID)

where you have set $ID as the topic user probably in the loop bit.

Don’t know, but worth having a further play


Viewing all articles
Browse latest Browse all 3685

Trending Articles