Support » Plugin: Achievements for WordPress » Sort Achievements

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


    I think you need to find the call to dpa_has_progress() in the templates, and pass these extra parameters:

    ‘orderby’ => ‘meta_value_num’,
    ‘meta_key’ => ‘_dpa_points’

    I found TWO files with the title “template.php”

    ONE in acheivements>>includes>>achievements
    One in achievements>>includes>>progress

    Which one do I modify?

    it also looks like there is already a call for the ‘orderby’ and is set as follows:
    'orderby' => 'date'
    Do I just modify this line to read:

    'orderby' => 'meta_value_num'

    Plugin Author Paul Gibbs


    You should never modify a plugin’s files, it will make upgrades much harder for you in the future. I’ll look back when I get time with some guidance on what files to copy to your theme, which you can then tweak.

    This I know….
    I wanted to know which file to copy into my theme folder with the proper modifications.

    Plugin Author Paul Gibbs


    Copy /achievements/templates/achievements/achievements/content-archive-achievements.php into /wp-content/themes/YOUR_THEME/achievements/

    Then edit that copy, and adjust the dpa_has_achievements() call which is not too far from the top of the file.

    For others who are as limited in their self-taught PHP as me, Paul means (or at least I think he does, but it worked for me), that the line

    <?php if ( dpa_has_achievements() ) : ?>

    in that template becomes

    <?php if ( dpa_has_achievements(array('orderby' => 'meta_value_num')) ) : ?>

    Took me a while to figure that out.

    Plugin Author Paul Gibbs


    Yep! Thanks stwc

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