Last active
March 2, 2023 18:29
-
-
Save braddalton/acd40ad6c81d545c631e0db49ce9db5a to your computer and use it in GitHub Desktop.
Add Pagination to AgentPress Pro Listings Archive Page https://wpsites.net/?p=111827
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do NOT copy this opening PHP tag. Code goes at end of functions.php | |
add_action( 'pre_get_posts', 'agentpress_pro_listings_pagination', 10 ); | |
function agentpress_pro_listings_pagination( $query ) { | |
if ( ! is_admin() && $query->is_main_query() && is_post_type_archive( 'listing' ) ) { | |
$query->set( 'posts_per_page', 12 ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment