Creates a shortcode for displaying the user’s rank progress without the need for Visual Composer. It will allow you to display the current user’s rank progress bar (default), or enter a User ID to display that particular user’s rank progress. And lastly, the ability to show/hide the name of the user’s current rank, their next rank, and their points progress.
Add this code snippet to your theme's functions.php file, or to a custom plugin. Then, copy the css from mycred-users-rank-progress-shortcode-css to your theme's style.css file. Change the styles to fit your needs (colors, sizes, etc.) Finally, use the shortcode like so: [mycred_users_rank_progress user_id="1" show_rank="yes"] *This will show the rank progress of the admin user with the current and next ranks displayed
Very neat.
I will keep this one in mind.
Hello Christian,
Thanks for sharing this snippet. Found it very helpful
A little help would be awesome: any way of modifying the code to work with the default wordpress logged in functions? i.e. if I don’t have buddypress installed? (actually, I have userpro instead of buddypress, so a userpro-based code would also work).
Thanks and keep up the great work!
Raied.
Greetings Raied,
I’m in the process of updating this code snippet for myCRED 1.6, and I will be adding support for default wordpress login functions. As far as userpro goes, I don’t personally own the plugin, and I don’t have any way of studying the code to find the userpro equivalent of the function that checks to see if you are currently viewing a user’s buddypress profile.
Great work, exactly what I was looking for!
Hi,
I would like to know if there is a way to view the articles that a user has already read, and propose a list of those still to be read
Thank you
Giorgio
After updating myCred from 1.6.9 to 1.7.2 some things stopped working using this code snippet with [mycred_users_rank_progress show_rank=”yes”]
– precentage always zero / 0%
– progress bar is always completed/ full
– rank base titel isn’t shown anymore (placed with random text from page)
Can someone help me out or have a fix?
Thx!
code I used: https://gist.github.com/codelion7/9cbd4dcf33d1716397e7
Try this:
– Find:
// Get the users current rank post ID
$users_rank = (int) mycred_get_users_rank( $user_id, ‘ID’ );
– Replace with:
// Get the users current rank post ID
$users_rank = mycred_get_users_rank_id( $user_id, $type_id );
It’s due the rewrite of rank functions brought with v1.7 that your code stopped working.
Awesome! Thanks. This fixes the problem.
Hello
It does not work on my website.
I can’t find a solution and the problem is that the page where I put the shortcode is now partially empty.
I can’t see the main content and the footer.
Do you have an idea to solve that ?
Thank you for your help
Hello, I’m using myCRED version 1.6.9 and BuddyPress version 2.6.1.1. I put the code on the function.php but it doesn’t show anything on the user profile of buddypress and if I just write on a random page created on wordpress admin with the shortcode ‘[mycred_users_rank_progress user_id=”1″ show_rank=”yes”]’ it shows a fatal error.
Any idea what could it be?
I’m using the theme ascent, just in case.
Thanks.
Ok I just made it work hahaha
now I’ll just like to know how to add it on the buddypress profile but within the code and not as a shortcode
Is this still working?
I’m getting a Fatal error as well.
“Fatal error: Call to a member function exclude_user() on a non-object in (path to theme)/functions.php on line 1092”
The code snippet is not compatible with 1.7. I will look at creating a new snippet for 1.7 so older versions can still use this version.
Is there a new snippet available yet?
Thanks for this but im getting a blank page when i use the shortcode. All i get is the themes header and everything else is blank. No warning or error. I have tried pasting it into my function.php file as well as putting it into a plugin and both have the same result. Am i missing something?
Try enabling WP_DEBUG in your wp-config.php file to see what error is causing the white screen.
For those having issues with this code snippet (not written by me so I can not apply the fix) check the fixes posted on gist: https://gist.github.com/codelion7/9cbd4dcf33d1716397e7#file-mycred-users-rank-progress-shortcode