Hallo,
I would like to sort first always the featured customers randomly and after them there should be the free listings also randomly sorted.
Is it possible to modify Vikas’ code to achieve this effect?
add_filter('pre_get_posts', 'geodir_apply_my_posts_orderby');
function geodir_apply_my_posts_orderby($query)
{
if ( isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
if(!is_admin())
add_filter('posts_orderby', 'geodir_my_posts_orderby' );
}
}
function geodir_my_posts_orderby($orderby)
{
global $wpdb;
if(!is_admin())
{
$orderby = str_replace(", $wpdb->posts.post_date desc" , '', $orderby);
}
return $orderby ;
}