pagination-sticky members-navigation not working properly
-
Hi,
i’ve created a website where the users must be displayed in a certain order. I control that order with a specific custom value called ‘order’. When displayed in the kleo-members-grid it is ordered correctly. But in the top nav, the radio buttons that show the previous member and the next member, display the users in a different way.My custom code in functions.php to order the users is this:
//Adjust BP User Query
add_action( ‘bp_pre_user_query’, ‘order_by_order’ );
function order_by_order( $BP_User_Query ) {
// Only run this if one of our custom options is selected
if ( in_array( $BP_User_Query->query_vars[‘type’], array( ‘order-asc’, ‘order-desc’ ) ) ) {
global $wpdb;// Adjust SELECT
$BP_User_Query->uid_clauses[‘select’] = ”
SELECT wp_users.id
FROM wp_users
LEFT JOIN wp_bp_xprofile_data ON (wp_bp_xprofile_data.user_id = wp_users.ID)
“;// LEFT JOIN wp_bp_xprofile_data ON (wp_bp_xprofile_data.user_id = wp_users.ID)
// Adjust WHERE
$BP_User_Query->uid_clauses[‘where’] = “WHERE wp_bp_xprofile_data.field_id = 12 “;// Adjust ORDER BY
//
$BP_User_Query->uid_clauses[‘orderby’] = “ORDER by wp_bp_xprofile_data.value+0”;// Adjust ORDER
//
$BP_User_Query->uid_clauses[‘order’] = ( $BP_User_Query->query_vars[‘type’] == ‘order-asc’ ) ? ‘ASC’ : ‘DESC’;
}
}Thanks.
- The topic ‘pagination-sticky members-navigation not working properly’ is closed to new replies.