Ussing page_navi with WP_Query

Just work including that code in the functions file:

function mod_query($query){
    $entradas = get_category_by_slug('anuncios');    
    if ((!is_admin() && $query->is_main_query())){
        $query->set('posts_per_page',"2");
        $query->set('cat','8');
    }
}
add_action('pre_get_posts','mod_query');

The file to show the content of the category is a normal file (without extra configuration)

Thanks to @Pieter Groosen for the orientation.