get understrap pagination to work with custom query

the pagination function does nothing with a custom loop

That’s because for custom loops or secondary WP_Query instances like your $catquery variable, you need to explicitly tell the function how many pages are available for your custom query.

So the $total argument (see the function’s description) should be set to the max_num_pages property of the query object, i.e. the $catquery variable:

understrap_pagination( [
    'total' => $catquery->max_num_pages,
] );

It’s that simple and the above should work. 🙂