Support » Plugin: Achievements for WordPress » Featured images in Achievement page

  • Resolved Darkooo


    hey all, thanks for fantastic plugin. I want to ask, have we a posibility to show achievement picture (as featured image) in “achievement name” cell at table (My achievements, single achievement page, Achievements)? how I can do it? Maybe it has a shortcode like <?php the_post_thumnail(‘thumbnail’); ?>? Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Oh, I found it. 🙂 Can use a code from achievement-unlocked.php for featured image. Thanks!

    Plugin Author Paul Gibbs


    Cool, glad you figured it.

    What exactly did you do to get it working? I wanted to implement this into my own site, but my PHP skills are… novice at best

    For those who have the same problem and want to show badges under the name of the achievement, I figured it out:

    Put this line of code into the loop-single-achievement.php file located under wp-content/plugins/achievements/templates/achievements/achievements. You should see this on line 21:
    <a href="<?php dpa_achievement_permalink(); ?>"><?php dpa_achievement_title(); ?></a>
    Underneath that, put this:

    <br />
    				if ( has_post_thumbnail( $notification->ID ) )
    					echo '<a href="' . esc_url( $url ) . '">' . get_the_post_thumbnail( $notification->ID, 'medium', array( 'class' => 'attachment-medium dpa-achievement-unlocked-thumbnail' ) ) . '</a>';

    That puts the featured image from that achievement underneath. Hope this helps somebody!

    Plugin Author Paul Gibbs


    Never ever ever modify core WordPress files or files that come with plugins. Just don’t; you loose all your changes when you upgrade to a future version of Achievements, and re-applying the change manually is time-consuming (at best).

    Suggest you copy the modified loop-single-achievement.php into:

    I think this will override the template from the version in your theme. Let me know. If it doesn’t, I’ll double-check that I have the directory correct.

    This seems to work for me, thanks for the help! Should help me with other plugins as well =)

    Plugin Author Paul Gibbs



Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Featured images in Achievement page’ is closed to new replies.