Query Loop Block – Incorrect pagination custom filter code

[ad_1]

I have added a filter to show a series of entries that meet certain requirements. The query is correct but the pagination is not correct. Shows the total number of pages you would have without filtering. I’m stuck and don’t understand why it’s happening. Here is my code in case you can help me. Thank you so much.

add_filter( 'generateblocks_query_loop_args', function( $query_args, $attributes ) {
    if (!is_admin() && !empty($attributes['className']) && strpos($attributes['className'], 'filtrar-por-practicas') !== false) {

        $query_args['meta_query'] = array(
            'relation' => 'AND',
            array(
                'key'     => 'alum_imgcasoexitotrasera',
                'compare' => '!=',
                'value'   => '',
            ),
            array(
                'key'     => 'alum_programa',
                'value'   => '15815',
                'compare' => 'LIKE'
            ),
        );
    }

    return $query_args;
}, 10, 2 );

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer