• Resolved strid3r

    (@strid3r)


    First off great plugin – gave you a 5 stars.

    My problem is I am trying to use shortcode to display listings while only showing x amount of listings per page. The WP Listings Settings page, you can control the Default Number of Posts per archive page. This works perfect for me when I use the auto-generated listings page (site.com/listings) but it does not work on the short code page nor does it work on the auto-generated property type page (site.com/property-types/residential).

    Do you know what I can do to make shortcode listings page only show x amount of listings and then have page 2, 3, 4, ect?

    Thank you for your help.

    https://www.ads-software.com/plugins/wp-listings/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author agentevolution

    (@agentevolution)

    The shortcode has a parameter of limit you can use to limit the number but it doesn’t support pagination – https://www.ads-software.com/plugins/wp-listings/installation/

    Otherwise, taxonomy pages use the default WP settings for posts per page under Settings > Reading.

    Thread Starter strid3r

    (@strid3r)

    Thank you for the response.
    Is there a way to display listings in two column layout while using pagination?

    Is there a way to display listings in auto-generated property type page (site.com/property-types/residential) while using pagination? This appears to not use the WP Listings Settings Default Number of Posts per archive page setting?

    Plugin Author agentevolution

    (@agentevolution)

    1. Yes, with a custom template. The template included in the plugin displays three columns.

    2. Taxonomy pages do not use the archive page setting, because the is_archive() function returns false on taxonomy pages.

    You can add this to your theme’s functions.php in order to use the same setting. This will apply to all taxonomy archive pages. If you want to limit which taxonomy pages, you’ll need to customize this function using is_tax() (https://codex.www.ads-software.com/Function_Reference/is_tax):

    function wp_listings_tax_post_number( $query ) {
    
    	if ( $query->is_main_query() && !is_admin() && is_tax() ) {
    
    	$options = get_option('plugin_wp_listings_settings');
    
    	$tax_archive_posts_num = $options['wp_listings_archive_posts_num'];
    
    	if ( empty($archive_posts_num) ) {
    		$tax_archive_posts_num = '9';
    	}
    
    	$query->query_vars['posts_per_page'] = $tax_archive_posts_num;
    
    	}
    }
    add_action( 'pre_get_posts', 'wp_listings_tax_post_number' );
    Thread Starter strid3r

    (@strid3r)

    Thank you very much. Thanks for your time and excellent plugin. I appreciate it. ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Listings per page for Short Code and Property Type’ is closed to new replies.