It will take affect (assume you are editing correct file), but when a user picks an item, BP stores a cookie which remembers the item selected. On subsequent page loads, javascript reads this cookie and picks the item again for you.
@djpaul, i re arranged it in members/index.php, but it just change the order of the filter tab, by default it still show last active member first on the list
If i could remember right, you can use the following code but i am not sure if it is outdated because i have it during BP 1.2.
function sort_alpha_by_default( $qs ) {
global $bp;
if (!$qs && ( $bp->current_component == BP_MEMBERS_SLUG || $bp->current_component == BP_GROUPS_SLUG) )
$qs = ’type=alphabetical&action=alphabetical’;
return $qs;
}
add_filter( ’bp_dtheme_ajax_querystring’, ’sort_alpha_by_default’ );
@naijaping, the code is not working, it close down my site. @djpaul, or any advance member, can you please help me check whats wrong with the code.
Thanks in advance
@funmi omoba:
At the top of members-loop.php replace the following code:
`
with: <?php /* My Custom Member Query to order alphabetical by default */
function my_query_filter_new ( $query_string ) {
$query_string .= ‘&per_page=15&type=alphabetical’;
return $query_string;
}
add_filter( ‘bp_ajax_querystring’, ‘my_query_filter_new’ );
?>
`
Note : you can change per page to any number you want
work like a charm
regards