How can I add a filter for specific categories on functions.php?

As pointed out in this answer, using the request filter means that some (if not all) of WordPress’s is_* functions are unavailable. Use the corresponding member functions of your new WP_Query instead, as they should be available.

function graphene_alter_the_query( $request ) {
    $dummy_query = new WP_Query(); 
    $dummy_query->parse_query( $request );
    if ( ! $dummy_query->is_category( 25 )) {
     $request['gdsr_sort'] = 'rating';
    } else {
        $request['gdsr_sort'] = 'comment_count';
    }
    return $request;
}
add_filter( 'request', 'graphene_alter_the_query' );

techhipbettruvabetnorabahisbahis forumutaraftarium24edusedusedusedueduedusedueduedusedu