This PHP code enables you to paginate a CPT archive page using pre_get_posts
with posts_per_page
.
This code overrides your WordPress Reading settings for your CPT archives, in this case, for a custom post type named listing. Swap out listing in the code for use with any other CPT.
Code gets pasted at the end of your child themes functions file or custom functionality plugin.
Leave a Reply