Support » Plugin: AgentPress Listings » Changing the number of listings on listings archive page

  • The listings archive page I am developing is just two rows of listings having 6 listings in total. Is there any way for me to change the number of rows and no. of listings on the page? The URL is as follows.
    https://www.halaljapan.com/listings/

    Thanks

    The page I need help with: [log in to see the link]

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.