Support » Plugin: BP Profile Search » Custom directory order by newest registered

  • Resolved andreadrago

    (@andreadrago)


    Hello Andrea,
    When you open a custom directory, the default sort option is “Last active”. Is there a way to change it to “Newest registered”?

    Thank you very much for this plugin, it has been very useful

    • This topic was modified 2 months, 2 weeks ago by andreadrago.
    • This topic was modified 2 months, 2 weeks ago by andreadrago.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Andrea Tarantini

    (@dontdream)

    Hello Andrea,

    Unfortunately that’s not possible with the current plugin, but I’m going to add this feature to my to-do list. Thanks!

    Hello Andrea,

    Thank you for your prompt response.
    Just to let you (and maybe others who ends up here) know, I solved this problem by editing the members-loop.php file in my child theme. I edited this string

    <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ): ?>

    into this:

    <?php
    	$query = bp_ajax_querystring( 'members' );
    	if (strpos($query, "type=") === FALSE) {
    		$query = "type=newest&".$query;
    		// little javascript to change the dropdown select index 
    		echo "<script>document.getElementById('members-order-by').selectedIndex = 1;</script>";
    	}
    ?>
    <?php if ( bp_has_members( $query ) ) : ?>

    It probably isn’t the best solution, since I believe it should be possible with php alone. I’ve written in the buddypress forum and waiting for an answer.

    Still, thank you very much for your support!

    Plugin Author Andrea Tarantini

    (@dontdream)

    You’re welcome, thank you for sharing your solution!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.