Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #16448

    jonahcoyote
    Full Member
    Post count: 48

    Hi there,

    Is there a way to show all listing on the map besides showing all posts per page? It might be nice to have both options so that some users can only show listings in the map that are on the current page, and another option to show all listings on the map regardless of how many listings are showing per page…

    Thanks,
    Jonah

    #16449

    jonahcoyote
    Full Member
    Post count: 48

    If anybody is wanting to adjust how many listings are shown per page or get it so the map will show all listings, just add this code to your themes functions.php file:

    
    /*-------------------------------------------------------------------------------
    	Show More Posts Per Page
    -------------------------------------------------------------------------------*/
    function show_more_posts($query) {
    	if ( empty( $query->query_vars['suppress_filters'] ) ) {
    		if( geodir_is_page('listing') || geodir_is_page('author') || geodir_is_page('search') ) {
    			$query->set( 'posts_per_page', -1 );
    		}
    	}
    	return $query;
    }
    add_filter( 'pre_get_posts' , 'show_more_posts' );
    

    That will affect listing, search and author GD pages.

    #16574

    paolo
    Site Admin
    Post count: 28920

    Thx for that.

    Just FYI, if you have several hundreds listings in any given category, with this snippet, the map could take much longer than the rest of the page to load.

    Cheers,

    #16575

    jonahcoyote
    Full Member
    Post count: 48

    No problem. Any thoughts on my question/suggestion/request to be able to show all listings on the map without my code though?

    #16577

    paolo
    Site Admin
    Post count: 28920

    I see three is note about it in our “improvements” to do list.

    We eventually want to change the way map markers are queried, moving the ajax calls in a separate file. This to be able to fetch them quicker and to be able to cache them too.

    When we will get to it, we will be able to also add options to display more markers in the map.

    Can’t tell today how soon this will be done.

    Thx

    #16680

    jonahcoyote
    Full Member
    Post count: 48

    Sounds good paolo, thanks!

    #18598

    Wayne Harvey
    Expired Member
    Post count: 102

    Hi there, I’m also looking to have the map on the listing pages show all of the listings. I tried the code provided above on the child theme functions.php file. It’s not working. Any ideas?

    #18649

    jonahcoyote
    Full Member
    Post count: 48

    Hey Wayne,

    What version of GD are you running? Are you sure you added it to the currently active child theme? Are you seeing any errors or is it just not working?

    – Jonah

    #18651

    Wayne Harvey
    Expired Member
    Post count: 102

    Hi Jonah
    Thanks for the quick reply. I’m running the latest version of GD (1.2.4) and have definitely added it to the active child theme. My funtions.php file has one other customization that is functioning. There are no errors, the listing pages just continue to load 5 listings only as before – not sure if there is a setting to change that at all but I am looking for a method to just load all listings on the map. Cheers!

    #18653

    paolo
    Site Admin
    Post count: 28920

    To show more listing in the list go to wp Settings >> Reading and change the number of visible posts.

    Thx

    #18664

    jonahcoyote
    Full Member
    Post count: 48

    Hey Wayne,

    I’m not sure why that code wouldn’t be working for you. Maybe try deactivating all other plugins to make sure no other plugin is interfering with things. You’ll need to troubleshoot on your own to figure it out. It works for me but unfortunately I can’t spend the time to figure out why it doesn’t work for you. Good luck!

    – Jonah

    #18729

    Wayne Harvey
    Expired Member
    Post count: 102

    Hey Jonah, Thanks for the assistance. Cheers, Wayne

    Hi Paolo,
    Thanks for the suggestion, went to the WP “reading” settings and they were at their default of 10 posts. Changing the setting did not have any effect whatsoever.
    When a user is viewing a province wide map by manually zooming in while on the homepage, then clicks on a detailed listing and then clicks on a “breadcrumb” link for the province, the behavior I’d expect is for the map to revert to showing all of the listings of the province, at least on the map if not on the list of listings.
    For example if you go to my site – http://cabinrentalsonly.com/ – zoom in to British Columbia, Canada, click on any listing and then try to revert to all BC listings by clicking on the BC breadcrumb, the user then sees only 5 pins. I’m not sure where the “5” is coming from. What I’d like to see happen under this scenario is for the map to display “all” BC listings, even if the listings in the main content area are limited and paginated.
    Any ideas? I would definitely +1 the addition of that functionality if I can’t achieve it by a code edit.
    Many thanks, Wayne

    #18747

    paolo
    Site Admin
    Post count: 28920

    HI,

    the listings page should show the number of posts set in reading settings.

    The map currently can only show the number of listings availalbe in the list below. Not all and that apparently can be achieved with the function provided by Jonah.

    In any case that would be a customization and you can request it here: https://wpgeodirectory.com/requests/

    Now to see why it is only showing 5 instead of what’s set in your reading setting, I would need admin credentials.

    Let me know,

    Thx

    #18781

    Wayne Harvey
    Expired Member
    Post count: 102
    This reply has been marked as private.
    #18833

    paolo
    Site Admin
    Post count: 28920

    Hi,

    the theme used “Divi by elegantthemes.com” have settings that overwrites the default wordpress reading settings.

    http://cabinrentalsonly.com/wp-admin/themes.php?page=core_functions.php

    and these were your settings:

    Number of Posts displayed on Category page 5
    Number of Posts displayed on Archive pages 6
    Number of Posts displayed on Search pages 5
    Number of Posts displayed on Tag pages 5

    I’ve changed Archive page to 10 and it works.

    I’ll set this as resolved.

    Thx

Viewing 15 posts - 1 through 15 (of 16 total)

The topic ‘Show All Listings on Map’ is closed to new replies, this may be for inactivity, please open a new topic if you have a similar question.

  • How to add a new support ticket

    To open a new support ticket, first select the relevant forum and then click the "New Post" button. Example: You need support for the core plugin? Click on GeoDirectory Core Plugin support and click on the "New Post Button".
  • Support Policy

    Please read the support policy before starting to use the forum.
  • Feature Requests

    Is there a theme for which you'd like to see a compatibility package or a new feature that you think would be of great benefit for the GeoDirectory community?

    Submit a feature request : here

    Each month you get 5 votes to distribute. You can choose to use all your votes for one idea you really like, or spread them across between several ideas :)

    We will do our best to create whatever you suggest if it becomes popular, we however reserve the right to reject ideas that we believe could not be realized without revolutionizing the plugin.

  • Are you a developer?

    Make Money with GD Jobs

    Get listed in the GeoDirectory Experts Directory. There may be a new client waiting for your services.
  • Looking for a GD developer?

    We do not provide customization services, but feel free to check out the GeoDirectory Experts Directory, there you'll find several freelance GD experts ready to start working with you.