Number of listings on search page

This topic contains 29 replies, has 4 voices, and was last updated by  Birgit Wilde 5 years, 12 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #476055

    Birgit Wilde
    Expired Member
    Post count: 236

    Hello,
    despite the respective settings in

    WP->Reading-> max. 25 Blog listings per page (see screenshot)

    on my GD search page really ALL listings of a CPT are shown.

    Also in my theme (supreme directory v2) I could not find anything that overrides this WP-setting.
    (Well, I am actually not that person who sees which css code may override other functions).

    Any idea?

    And once there is a pagination and limited number of listings on the search page displayd, I still would like to have the pins of ALL listings displayd on the GD map on my search page.

    How can I achieve that?

    Best regards
    Birgit

    #476057

    Guust
    Moderator
    Post count: 29970

    You need to change this code on line 9 of /wp-content/themes/supreme-directory/content-geodirectory-archive.php

    <?php echo do_shortcode('[gd_map width="100%" height="100vh" maptype="ROADMAP" zoom="0" map_type="auto"]');?>

    Just add all_posts=”1″ to that shortcode.

    If we need to check anything else, post your URL and WP admin details in a private reply.

    Thanks

    #476326

    Birgit Wilde
    Expired Member
    Post count: 236
    This reply has been marked as private.
    #476336

    Guust
    Moderator
    Post count: 29970

    I de-activated your code snippets. One of them is breaking the category and search page.
    Turn the snippets on one by one again to find the error.
    Thanks

    #476339

    Birgit Wilde
    Expired Member
    Post count: 236

    Hi Guust,
    great, thank you. I will check the snippets.

    Now the map on the right side shows onlay as many listings as are displaid on the left. How can I achieve it that the map on the right shows ALL listings while on the left only xx listings per page are dislaid?

    Many thanks
    Birgit

    #476344

    Birgit Wilde
    Expired Member
    Post count: 236

    Ah, I found the snippet.
    It is exactly the one managing that even though there are not all listings displaid at once on the lefthand side of the search page, the map on the right shows all listings.

    This code I got from some entry in the forum (see below).
    How to I have to adjust this code to make it work for GDV2?

    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’ );

    #476405

    Guust
    Moderator
    Post count: 29970
    #476465

    Birgit Wilde
    Expired Member
    Post count: 236

    Hi Guust,

    the snippet that broke the pagination is deactivated and I have added the php-code all_posts=”1″ as described (see screenshot) and uploaded it back on the FTP-server.

    Now I have my pagination back, but the map does not show all listings of a CPT but only those listed on the left.

    Any idea?

    Many thanks
    Birgit

    #476474

    Guust
    Moderator
    Post count: 29970
    This reply has been marked as private.
    #476656

    Kiran
    Moderator
    Post count: 7069

    Hi Birgit,

    Pleas check now.

    In file /themes/supreme-directory/content-geodirectory-archive.php i have added all_posts=1 in gd_map shortcodes.

    Regards,
    Kiran

    #476818

    Birgit Wilde
    Expired Member
    Post count: 236

    Hi Kiran,
    sorry, it seems it doesn’t work yet. The map on GD Archive still shows just those listings that are currently listed on the lefthand side of GD Archive.
    Any other idea?
    Many thanks and best regards
    Birgit

    #476910

    Alex Rollin
    Moderator
    Post count: 27815

    Hi,

    The archive map will only show all the listings in the loop, so, whatever is returned by the loop will shop on the map.

    Make sense?

    #477208

    Birgit Wilde
    Expired Member
    Post count: 236

    Hi Alex,
    by “all the listings in the loop” do you mean only those listings displaid on the lefthand side (amount depending on page settings)? This is how it is right now.

    It would be so much better if the visitor/user could see at a glance that there are many more listings in this database and where about in Germany they are.

    Therefore I used to have this lovely snippet from the support team (see screenshot) which now with GDV2 doesn’t work properly anymore.

    The next step to perfection would be to display the listings currently listed on the lefthand side on the map with map pins and all the other listings as little dots. Thus the user could see where else in Germany the database provides listings and at the same time know the locations of the listings currently shown on the lefthand side. Okay, this might be really a matter of individual customization.

    But for now it would be great to be able to just show all listings on the map, resp. to gain back the functionality of that snippet.

    Any idea?
    Many thanks
    Birgit

    #477222

    Alex Rollin
    Moderator
    Post count: 27815

    By loop I mean the GD Loop element, which shows the main query for the archive page, whichever archive page it is.

    Showing listings from a GD Listings shortcode in a map is not possible except by using the directory map element with filters matched to a gd listings element.

    If you want more than that right now you will need to customize it.

    #477223

    Guust
    Moderator
    Post count: 29970

    The archive page for example “loops” through all listings in that custom post type, and finds about a thousand.
    Because the left hand side is set to 25 listings, a 1000 listings will be divided in 40 pages.
    Because the right hand side is set to show all in the “loop” it will show all there, see image.

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount