Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Popular Features › Members Directory › Sorting by default
- This topic has 5 replies, 2 voices, and was last updated 5 years, 1 month ago by
Themosaurusrex.
-
AuthorPosts
-
Gilles DeronParticipant@gillesderon
- 31 Topics
- 97 Posts
Hello dear Themosaurus experts,
In this topic, I searched help to change the members directory defalut sorting to ‘Newest’.
Olivier @themosaurusrex, kindly gave me clues, but I do not have the desired effect.
I changed the code of members-loop.php in Legacy and Nouveau:
<?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>
to
<?php if ( bp_has_members( bp_ajax_querystring( 'members' ). '&type=newest' ) ) : ?>
.
But the sorting by default is always on last active…Could you help me with this?
March 16, 2020 at 15:32 #10663@themosaurusrex- 0 Topics
- 2048 Posts
Hi @gillesderon,
When you say:
I changed the code of members-loop.php in Legacy and Nouveau
Did you change this inside BuddyPress code? Did you write an additional code snippet? Did you add custom code to your child theme?
Thank you.
March 17, 2020 at 12:19 #10688Gilles DeronParticipant@gillesderon- 31 Topics
- 97 Posts
Hi Olivier,
I change the code in the Buddypress files.
March 17, 2020 at 13:36 #10693@themosaurusrex- 0 Topics
- 2048 Posts
Hi @gillesderon,
Ok, I hope it’s only for testing purposes. Otherwise, it’s considered bad practice as your changes will be erased with the next updates. ?
To add this code snippet to your site, we always recommend that you use a the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/). If you have never activated this plugin, please read the following post:
Furthermore, I add to place your code using the following BP filter:
bp_ajax_querystring
For more, please read the following post:If your code doesn’t apply, it’s probably due to another function added to that filter and taking priority over yours. So, you could consider applying your new function with the lowest priority possible, to make sure is triggered last. Something like a
9999
priority should work.I hope this will help.
Please don’t hesitate to try to reach the BuddyPress authors also. They will be more informed and better suited to help you.
You can post also your request on their support forums:
https://buddypress.org/support/We remain available for all support requests related with the use of your theme.
Best,
March 19, 2020 at 10:51 #10733Gilles DeronParticipant@gillesderon- 31 Topics
- 97 Posts
Hi Olivier @themosaurusrex,
Of course, it was for testing. My question is : is the change I made correct?
And the problem with Buddypress support is they do not answer….
March 19, 2020 at 14:15 #10742@themosaurusrex- 0 Topics
- 2048 Posts
Hi @gillesderon,
We’re sorry about that. Unfortunately, we cannot provide answer all questions related with BuddyPress as it is outside the scope of the support we will provide for our theme and plugins.
In any case, adding your snippet with the suggested plugin to the suggest filter should do the trick. ?
Playing with the priorities for your function should ensure that your code will be executed after any code from a third party plugin or our theme.Cheers,
March 20, 2020 at 12:44 #10778 -
AuthorPosts
Hi there,
This topic has been inactive for a while now so we will be closing it to keep the forum tidy. Don't hesitate to create a new topic if you still need help and we'll be glad to help you!
Best regards,
The Themosaurus team.
The topic ‘Sorting by default’ is closed to new replies.