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

  1. Pin
    Posted 3 years 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?



  2. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 3 years 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. Pin
    Posted 3 years 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.


  4. veioviss
    Posted 2 years ago #

    Is there an update to this?

  5. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 2 years 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

  • Achievements for WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic