Ah gotcha.
The video should do well enough. Without being able to dive deep into any code for it, I’d wager it’s just plucking out the last achievement that a user has earned, from their user meta and displaying information about it using its achievement ID, which is just a post ID.
Try out the following custom function. It may need some tweaking since it can return individual steps, but this will get you on your way:
function my_badgeos_get_latest_achievement( $user_id = 0 ) {
if ( empty( $user_id ) ) {
$user_id = get_current_user_id();
}
$achievements = badgeos_get_user_achievements( $user_id );
if ( !empty( $achievements ) ) {
return end( $achievements );
}
return array();
}
Usage:
$latest = my_badgeos_get_latest_achievement();
echo get_the_post_thumbnail( $latest->ID, 'large' );
All you really need to do is use the function and assign the return value to a variable, and then you’d have a variable that has the following:
$latest->ID
$latest->post_type
$latest->poinsts
$latest->date_earned
The ID is the most important part because it’d allow you query for pretty much anything related to the achievement. The post_type is the achievement type its’ related to.
The function declaration simply checks for a user ID to use, and if none is provided, it’ll just use the current user’s. Then it’ll grab the user’s earned achievements and return either an empty array if there are none, or the latest one earned which will be at the end of the saved value.