You can use the wordpoints_display_points() function. You just need to provide it the user’s ID, the slug of the points type, and a “context” string.
It would look something like this:
echo esc_html( $author->user_firstname ) . ' has ';
wordpoints_display_points( $author->ID, 'points', 'author-profile' );
Thread Starter
robint
(@robint)
I’m trying to add it to the menu bar;
<?php
$points = $wordpoints_display_points();
?>
<li><a href="http://website.com/top-user-points/"> Points (<?php echo $wordpoints_display_points( $author->ID; ?>)</a></li>
What have I done wrong?
Try this:
<li><a href="http://website.com/top-user-points/"> Points (<?php wordpoints_display_points( $author->ID, 'points', '' ); ?>)</a></li>
If that doesn’t work, you can send me a copy of the template, or post a link to the code, and I’ll try to find the problem.
Thread Starter
robint
(@robint)
Nearly there,
It’s displaying apart from the number.
I’m adding it to the header.php
Therefore it requires a hook call.
Similar to;
<?php
$fep = new fep_main_class();
$numNew = $fep->getNewMsgs();
?>
Placed just above;
<li><a href="http://xxxx.com/top-user-points/"> Points(<?php wordpoints_display_points( $user_info->ID, 'points', '' ); ?>)</a></li>
Thread Starter
robint
(@robint)
Got it to work with ;
<li><a href="http://guysandgirls.directory/top-user-points/"> Points(<?php echo do_shortcode( '[wordpoints_points points_type="points"]' );?>)</a></li>