Previous Next Button Not Filtering Based On Location
This topic contains 31 replies, has 3 voices, and was last updated by Kiran 5 years, 10 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: Previous Next Buttons
-
AuthorPosts
-
June 14, 2018 at 3:37 am #434927
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 );
June 14, 2018 at 11:27 am #434969This reply has been marked as private.June 14, 2018 at 12:57 pm #434982Hello,
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,
KiranJune 14, 2018 at 4:35 pm #435010I 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
June 14, 2018 at 9:28 pm #435024If 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/
June 15, 2018 at 5:21 pm #435107It does not
June 15, 2018 at 8:41 pm #435114Please provide site details and we will take a look at what’s happening there.
June 15, 2018 at 10:39 pm #435121This reply has been marked as private.June 16, 2018 at 7:00 am #435131The 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
June 16, 2018 at 8:23 am #435140Hey 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.
June 16, 2018 at 4:23 pm #435179Hello,
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.
June 18, 2018 at 5:54 am #435303This reply has been marked as private.June 19, 2018 at 6:46 pm #435544This reply has been marked as private.June 19, 2018 at 6:58 pm #435548This reply has been marked as private.June 19, 2018 at 9:54 pm #435576This reply has been marked as private. -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket