WordPress.org

Ready to get started?Download WordPress

Forums

Achievements for WordPress
[resolved] [closed] How to display an award on profile page (5 posts)

  1. icepin
    Member
    Posted 10 months ago #

    (for Buddypress) Similar to how to display the total points on a user's profile header

    echo dpa_get_user_points( bp_displayed_user_id() );
    anyone can tell how to call the last award given and display the featured image on the profile header or a specific award by ID?

    Cheers!

    http://wordpress.org/extend/plugins/achievements/

  2. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 10 months ago #

    dpa_get_user_last_unlocked( $user_id ) will return the post ID of the achievement the user unlocked last.

    I think you should be able to grab the image URL via http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail

  3. icepin
    Member
    Posted 10 months ago #

    yap, it works. If anyone interested:

    <?php echo get_the_post_thumbnail( dpa_get_user_last_unlocked( bp_displayed_user_id()), 'thumbnail'); ?>

    But, how can I tweak this code in order to get a specific achievement ID and display it? If user x has unlocked achievement y, display it.

    Regards

  4. veioviss
    Member
    Posted 4 weeks ago #

    Is there an update to this?

  5. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 4 weeks ago #

    This thread is 9 months old. You're best to start a new topic, please.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic