Support » Plugin: Achievements for WordPress » Medal image

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Paul Gibbs

    (@djpaul)

    Oh, display the graphic you set on the achievement in that table, right?

    Yeah! thank! ^^

    halleg

    (@halleg)

    +1 – good idea. If you follow it, you can have there presented the last achievements in each category (if category of achievement exists):

    e.g. a medal as recognition, a level achievement, a special prize…

    It can give a whole new dimension to the leaderboard.

    H

    Plugin Author Paul Gibbs

    (@djpaul)

    1) Copy /plugins/achievements/templates/achievements/achievements/loop-achievements.php and /loop-single-achievement.php into /themes/YOUR_THEME/achievements/.
    2) Those two files should now be copied to /themes/YOUR_THEME/achievements/loop-achievements.php and /themes/YOUR_THEME/achievements/loop-single-achievement.php. Open these in a text editor.
    3) You might want to add a new column to the table for the picture. Regardless, use the following code in the template to add the picture:

    <?php dpa_achievement_image();

    Apokh

    (@apokh)

    Hey, I also want to realize a more beautiful Achivement list. I managed to display the image but somehow I dont get the table done.

    Can you please specify which files I have to edit?

    Apokh

    (@apokh)

    By now i edited loop-achievements.php like

    <table class="dpa-archive-achievements">
    	<caption class="screen-reader-text"><?php _e( 'All of the available achievements with the name, avatar, and karma points for each.', 'dpa' ); ?></caption>
    
    	<thead>
    		<tr>
    			<th id="dpa-archive-achievements-image" scope="col"><?php _ex( 'Bild', 'column header for list of achievements', 'dpa' ); ?></th>
    			<th id="dpa-archive-achievements-name" scope="col"><?php _ex( 'Achievement Name', 'column header for list of achievements', 'dpa' ); ?></th>
    			<th id="dpa-archive-achievements-karma" scope="col"><?php _ex( 'Karma', 'column header for list of achievements', 'dpa' ); ?></th>
    			<th id="dpa-archive-achievements-excerpt" scope="col"><?php _ex( 'Beschreibung', 'column header for list of achievements', 'dpa' ); ?></th>
    
    		</tr>
    	</thead>
    
    	<tfoot>
    		<tr>
    			<th scope="col"><?php _ex( 'Achievement Image', 'column header for list of achievements', 'dpa' ); ?></th>
    			<th scope="col"><?php _ex( 'Achievement Name', 'column header for list of achievements', 'dpa' ); ?></th>
    			<th scope="col"><?php _ex( 'Karma', 'column header for list of achievements', 'dpa' ); ?></th>
    			<th scope="col"><?php _ex( 'Beschreibungn', 'column header for list of achievements', 'dpa' ); ?></th>
    
    		</tr>
    	</tfoot>

    and the single-achievements.php like

    <td headers="dpa-archive-achievements-image">
    		<?php do_action( 'dpa_template_before_achievement_image' ); ?>
    
    		<?php dpa_achievement_image();?>
    
    		<?php do_action( 'dpa_template_after_achievement_image' ); ?>
    	</td>

    Next question would be, where I can rename the table headers 😉

    Plugin Author Paul Gibbs

    (@djpaul)

    Table headers are in loop-achievements.php in the <th> blocks? If you’re editing these templates, you may as well rename the headings here — it’s just as easy.

    Apokh

    (@apokh)

    Found it. Thanks^^
    How can I now Order the Achievements, lets say by Karma asc.?
    Or better how to Order them within the category?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Medal image’ is closed to new replies.