Achievements for WordPress
[resolved] Displaying Data in the users profile tab? [Over 3 hours spent trying] (4 posts)

  1. Evolutionsic
    Posted 1 year ago #

    Hey Great Plugin! Please note I have tried for over 3 hours trying to do this and don't want to waste anyone's time so sorry in advance.

    So i've got my profile page setup which shows the users posts/comments in tabs beside each other i've added a achievement tab and would like to display the achievements users have earned.

    Here's the code, If you can see where i'm failing please help :p

    <ul id="author-tabs" class="nav nav-tabs clearfix">
      <li class="active"><a href="#ht-author-posts" data-toggle="tab"><?php _e( "Posts", "framework" ); ?></a></li>
      <li><a href="#ht-author-comments" data-toggle="tab"><?php _e( "Comments", "framework" ); ?></a></li>
      <li class="active"><a href="[get_user_ach_link]" data-toggle="tab"><?php _e( "Achievements", "framework" ); ?></a></li>

    I've also inserted this to my functions

    function get_user_achievement_page ($user_id) {
    $user_profile_url = dpa_get_user_avatar_link( array(
    		'type'    => 'url',
    		'user_id' => get_current_user_id(),
    	) );
    return $user_profile_url;

    The Achievement tab shows fine and correctly but doesn't function.

    website url is http://www.authenticspot.com

    you can view the profile page here with the problem in question

    then you can view the achievements i'd like to add into the tab here


  2. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 1 year ago #


    How exactly is this broken? What does is it do, and what behaviour are you expecting?

    It looks like you're trying to use a shortcode, [get_user_ach_link]. Did you copy this shortcode from somewhere else, or have you registered your own shortcode?

  3. Evolutionsic
    Posted 1 year ago #

    Hi Paul, I'm trying to get the user achievements to show in the tabs beside post/comments on the user profiles. I found the short code on a thread on here

    I don't believe it's broken i think I'm just failing at putting the right code in

    Here is a screenshot of what i'd like it to do


  4. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 1 year ago #

    [get_user_ach_link] isn't from Achievements, so it won't do anything. Perhaps it was some example code that someone else shared that confused.

    As URLs like http://www.authenticspot.com/author/middleton/achievements/ already work, how about linking your tab to that URL? You'll need to customise the author achievements template to add back the rest of your template customisations that you've made to author.php.

    Copy plugins/achievements/templates/achievements/achievements/content-author-achievement.php into themes/YOUR_THEME_HERE/achievements/content-author-achievement.php.

    What this will do is force Achievements to load this template from the file in your theme, instead of the bundled version that comes with Achievements. If you make a test edit to this new file, you should see the changes appear at http://www.authenticspot.com/author/middleton/achievements/

    I think this is going to be the easiest approach.

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


No tags yet.