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

    (@djpaul)

    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’

    Thread Starter joejozwowski

    (@joejozwowski)

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

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

    Which one do I modify?

    Thread Starter joejozwowski

    (@joejozwowski)

    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 Wong-Gibbs

    (@djpaul)

    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.

    Thread Starter joejozwowski

    (@joejozwowski)

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

    Plugin Author Paul Wong-Gibbs

    (@djpaul)

    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 Wong-Gibbs

    (@djpaul)

    Yep! Thanks stwc

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