Hello, I’m editing the file (addons/social/functions/hooks-actions.php) and near following and follower count I need to add user post count and user comment count.
I add this for user post count and work:
<?php $user_post_count = count_user_posts( $user_id ); ?><?php echo $user_post_count ?> posts
Now I try to add user comment but not work, I try this:
<?php function commentCount() { global $wpdb; $count = $wpdb->get_var(‘SELECT COUNT(comment_ID) FROM ‘ . $wpdb->comments. ‘ WHERE comment_author_email = “‘ . get_comment_author_email() . ‘”‘); echo $count . ‘ comments’; } ?>
<?php commentCount(); ?>
This function show me all site comments count..
What’s wrong?
You must be logged in to reply to this topic.
Here you can find help from UserPro plugin developers and other UserPro fellow users. Please be polite and ask your questions. NO SPAM!