Previous Next Button Not Filtering Based On Location

This topic contains 31 replies, has 3 voices, and was last updated by  Kiran 5 years, 9 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #434927

    Jim Cibelli
    Expired Member
    Post count: 98

    Hey, I have used this code so I could move the previous and next button up on the listing detail page and it was working. By that I mean when you searched a listing and clicked previous and next it would go to the next listing on the listing page.

    Now when you click next/previous it goes to some random page and I don’t know why.

    I have re-enabled the default previous/next button on the site and added a location filter but and the results were different but still seemingly random

    Code as it is

    
    
    <!--Need Previous/Next Code Here-->
    <div>
    <div class="post_nav">
     <span class="next_post_link"><?php previous_post_link( '%link','Next Restaurant ⇨ ' ) ?></span>
    <span class="previous_post_link"> <?php next_post_link( '%link','⇦ Previous Restaurant' ) ?></span>
    </div>
    </div>
    
    <?php
    remove_action('geodir_details_main_content', 'geodir_action_details_next_prev', 80);
    ?>

    Readed Geodir Buttons

    
    
    
    add_action('geodir_details_main_content', 'geodir_action_details_next_prev', 80);
    add_filter( 'get_previous_post_where' , 11, 5 );
    add_filter( 'get_next_post_where' , 11, 5 );
    
    #434969

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #434982

    Kiran
    Moderator
    Post count: 7069

    Hello,

    By default next / previous links filters current post’s location to find next / previous listing. If you have done any customization for next/previous links then remove it and check if is working or not.

    Thanks,
    Kiran

    #435010

    Jim Cibelli
    Expired Member
    Post count: 98

    I added it back using this code

    add_action('geodir_details_main_content', 'geodir_action_details_next_prev', 80);

    And I still went form a Seattle listing to a California listing. I looked to see if anything was similar like a category but the one in California has a default category and the one in Seattle has a best restaurants category

    #435024

    Alex Rollin
    Moderator
    Post count: 27815

    If you remove all the snippets you are applying to this feature so that only the default is in operation, does it function as originally intended?

    Here is a search on the demo:

    https://wpgeo.directory/supreme-directory/places/united-states/new-york/new-york/restaurants/gusto/

    Though “Tasty” is the listing after Gusto in the search, if you open Gusto and click on next it opens the Statue of Libery listing which is in New York with Gusto.

    https://wpgeo.directory/supreme-directory/places/united-states/new-york/new-york/restaurants/gusto/

    #435107

    Jim Cibelli
    Expired Member
    Post count: 98

    It does not

    #435114

    Alex Rollin
    Moderator
    Post count: 27815

    Please provide site details and we will take a look at what’s happening there.

    #435121

    Jim Cibelli
    Expired Member
    Post count: 98
    This reply has been marked as private.
    #435131

    Alex Rollin
    Moderator
    Post count: 27815

    The location page URLs are not working because region is not included in the URL.

    Please change the options at GD Permalinks to include City and Region or the complete location in the URL.

    See this link for more information: https://wpgeodirectory.com/docs/core-permalinks/#url

    #435140

    Jim Cibelli
    Expired Member
    Post count: 98

    Hey Alex,

    Thanks for the help so far but we seem to still be having issues. I went into Permalink->Add Location URL->Add Full Location and the default Previous/Next code is still not filtering by location and when I click them I’ll be in a Florida listing and hit next only to be in a California listing.

    I guess what we really want is when someone types in a search and get to this page-https://vrconcierge.com/?geodir_search=1&stype=gd_restaurant&s=+&snear=Seattle&sgeodir_cuisine%5B%5D=&sgeo_lat=47.6062095&sgeo_lon=-122.3320708

    When they click on a listing and hit previous and next they go up and down the listings on this page.

    #435179

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    I don’t think that is to use previous/next to page through search results without a customization, but I will flag your question for the developers.

    #435303

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    #435544

    Jim Cibelli
    Expired Member
    Post count: 98
    This reply has been marked as private.
    #435548

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #435576

    Jim Cibelli
    Expired Member
    Post count: 98
    This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 32 total)

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

Open Support Ticket