Viewing 2 replies - 1 through 2 (of 2 total)
  • You can use pre_get_posts for that.

    Hi there, for a direct answer, just paste the following in your functions.php

    // Change number of listings to 12.
    add_action( ‘pre_get_posts’, ‘awd_listings_archive_posts’ );
    function awd_listings_archive_posts( $query ) {

    if ( $query->is_main_query() && ! is_admin() && is_post_type_archive( ‘listing’ ) ) {

    $query->set( ‘posts_per_page’, ’12’ );
    }
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Changing the number of listings on listings archive page’ is closed to new replies.