You should use pre_get_posts
hook, which allows you to target one (or multiple) query precisely and change it so that everything works correctly (which is rarely result of manipulating main query in template, especially with pagination).
You should use pre_get_posts
hook, which allows you to target one (or multiple) query precisely and change it so that everything works correctly (which is rarely result of manipulating main query in template, especially with pagination).