Is there a way to by-pass the pagination function on one custom template?
The best way to do this is to use the pre_get_posts filter, which changes the main query. That way you’re not running the default query plus a custom one on top of it. You’ll have to determine the “if” conditions to only run on the query you want to affect: <?php function wpse_366882_get_all_posts($query) { // … Read more