• Resolved mungbean

    (@mungbean)


    Hi there

    With the Map View for the directory, I noticed there is pagination. This seems odd, I’d imagine the map containing all directory entries on one map (aggregate). Can pagination be turned off for map view?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @mungbean,

    Map View actually uses the Post Per Page set on your All Listings Settings (Settings > All Listings). So if it sets to 10, it’ll show 10 listings per page and thus you’ll have the pagination.
    If you want, you can use this snippet to increase the number of listings you want to show per page, only for Map view:

    add_filter("atbdp_listing_search_query_argument", function($args) {
    	if($_GET['view'] == 'map') {
    		$args['posts_per_page'] = 1000;
    	}
    	return $args;
    });
    add_filter("atbdp_all_listings_query_arguments", function($args) {
    	if($_GET['view'] == 'map') {
    		$args['posts_per_page'] = 1000;
    	}
    	return $args;
    });

    Please note that this snippet won’t work if your default view is Map View.

    Hope this helps, let me know if there’s anything else.

    Regards,

    Thread Starter mungbean

    (@mungbean)

    Thanks, Mahdi. If Map View is default, does it ignore pagination?

    Will you be adding this as an option to the settings? This seems like a useful addition (turn off pagination for Map View)

    Hi @mungbean,

    No, if Map View is the default for you, this snippet won’t work. In that case, you can use this:

    add_filter("atbdp_listing_search_query_argument", function($args) {
    	if($_GET['view'] != 'grid' || $_GET['view'] != 'list' || $_GET['view'] == 'map') {
    		$args['posts_per_page'] = 1000;
    	}
    	return $args;
    });
    add_filter("atbdp_all_listings_query_arguments", function($args) {
    	if($_GET['view'] != 'grid' || $_GET['view'] != 'list' || $_GET['view'] == 'map') {
    		$args['posts_per_page'] = 1000;
    	}
    	return $args;
    });

    This will remove the pagination on Map View, you can copy-paste this on your themes functions.php or use any code snippet plugin.

    Anyway, I’ll pass the request to add an option to remove pagination on map view as a feature request, thank you for your suggestion.

    Regards,
    Mahdi.

    Thread Starter mungbean

    (@mungbean)

    Thanks, I think a map-centric UI option would be a very powerful capability, especially when combined with category-colored pins. And, if the map can center automatically based on the user’s location, that would be even cooler.

    I look forward to the future capability.

    Hi @mungbean,

    Thank you so much for your suggestions. We’re always looking for ways to improve our product, make it more user-friendly. So we really appreciate you taking your time to make suggestions.

    Regards,
    Mahdi.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Remove Map View Pagination?’ is closed to new replies.