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

User’s replies / topics outside the profile page

$
0
0

WP : 5.0.2
bbPress : 2.5.14
Theme : Custom (built with _S)

Hi everyone,

Im trying to simply display the number of “points” earned by the current user (points = replies + topics), but outside the profile page (in my header actually, so basically on my whole website).

Here is what I tried :

<?php

$topics = bbp_get_user_topic_count_raw();
$replies = bbp_get_user_reply_count_raw();

$totalTopics = $topics * 5;
$totalsReplies = $replies * 2;

$points = $totalTopics + $totalsReplies;

echo ” points = $points.”;

?>

When Im on the user’s profile page, this code worked lovely, but when Im outside of this page, anywhere on my website, it displays nothing.
Any idea of what is exactly my issue ?

Cheers,

Chaaampy.


Viewing all articles
Browse latest Browse all 3646

Trending Articles