Thread Starter
RLL18
(@rll18)
The reason I want this is because I may manually award points. Points that aren’t gained through achievements…
The dpa_user_points()
function will print the number of karma points a user has.
Thread Starter
RLL18
(@rll18)
I’m not 100% familiar with coding. I type just that piece of code where I want it and it will work?
I have tried in several different files both with <php>
coding as well as stand alone, and I haven’t been able to get it to work how I want it. I want it to display a total number of points earned on the table that shows the acheivements earned (either at the top or bottom). Can you help me with the file that I need to add the code to?
My ultimate goal is to have the table located on the achievements page look like this:
achievement >> karma points >> description
achievement >> karma points >> description
achievement >> karma points >> description
Total achievements completed >> total karma points earned
Oh, and thank you for the response!!
Because the results can be paginated, do you want to overall total karma points number, or just add the karma points together for the displayed results?
Thread Starter
RLL18
(@rll18)
overall total karma points. I would like it to be displayed in the acievements table.
I can’t walk you through customising the templates step-by-step (if you’re not familiar with PHP and WordPress development/theming, it could be tricky), but basically you need to do this:
1) Copy /plugins/achievements/templates/achievements/achievements/loop-achievements.php to /themes/YOUR_THEME/achievements/loop-achievements.php
1) Copy /plugins/achievements/templates/achievements/achievements/loop-single-achievement.php to /themes/YOUR_THEME/achievements/loop-single-achievement.php
2) Open the new loop-achievements.php in a text editor, and add a new column to the table (the th
elements).
3) Open the new loop-single-achievement, and add in the new cell (td
, this time). For the value, use the dpa_user_points()
function to print the row’s user’s points total, something like this: <td><?php dpa_user_points(); ?></td>
.