Paid Memberships Pro
[resolved] Control order that memberships are displayed on levels page (8 posts)

  1. Lisa
    Posted 3 years ago #

    How can I control the order that my memberships are displayed on my levels page?

    I entered my new membership ID's in order from 4-10, because that is the order that I wanted them displayed on the page.

    They do not display in that order, nor in order by price or alphabetically


    They should be displayed in this order according to the order of the ID's in the admin:

    ID 4 IDFX
    ID 5 IDPX
    ID 6 Practicum
    ID 7 Multiple Choice
    ID 8 Triple Play
    ID 9 Pass the Practicum
    ID 10 All Access Pass


  2. Jason Coleman
    Plugin Author

    Posted 3 years ago #

    The "pmpro_levels_array" filter passes the array of levels and you can then sort it how you need to.

    It is funny that our pmpro_getAllLevels() function doesn't specify an order in the SQL query. So it would return the levels in random (but weighted toward ordering by ids) order. I'll fix that in the next update to order by id. Here's that function in GitHub:

  3. Lisa
    Posted 3 years ago #


    Thanks Jason,

    I eventually removed some of my levels as it was overwhelming anyway, but it would be great to be able to sort, or at least know they would be presented in order by id.

  4. mbenatar
    Posted 3 years ago #

    Not sure if I understand this correctly AND I have seven membership levels that need to be in a specific order.
    \I am not a coder> Could you help me with the function? I went to the link that you posted but it's a little confusing to me as to how to implement the code.

    Thank You,

  5. Jason Coleman
    Plugin Author

    Posted 3 years ago #

    mbenatar, if you can wait, the next version of PMPro will have this update included.

    Otherwise, you should be able to safely overwrite your copy of paid-memberships-pro/includes/functions.php with the "raw" version of that file at the GitHub link.

  6. mbenatar
    Posted 3 years ago #

    I tried to copy the code directly into my paid-memberships-pro/includes/functions.php via FTP with my webhost. I came up with a blank screen and could not log backin to my wordpress admin screen.

    What am I doing wrong?


  7. rdkelsey
    Posted 3 years ago #

    I'm confused here also, and need to re-order the levels as they were originally set up.

    I have Level 1, Level 2 and Level 3, each as a different membership level. They are ID 1, 2 and 3 respectively.

    Now the boss wants to add another level that is a Free Trial and wants it listed first, rather than how ID 4 puts it at the end.

    How can I re-order the membership levels to be ID 4, ID 1, ID2 and ID 3?

    Thanks in advance for any help with this.

  8. inator
    Posted 3 years ago #

    I solved this in my levels.php page template by adding:

    global $wpdb, $pmpro_msg, $pmpro_msgt, $pmpro_levels, $current_user, $pmpro_currency_symbol;
    //fix for level order issue
    //see http://wordpress.org/support/topic/control-order-that-memberships-are-displayed-on-levels-page

    Just add it right after the globals declaration (as shown above) and all will be right with your world.

    As an alternative, the functions.php could be modified to do the same, but I didn't want to mess with modifying the plugin source. I created my own custom template pages so I'm good!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Paid Memberships Pro
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic