Sorting Listings by Custom Fields
This topic contains 5 replies, has 4 voices, and was last updated by Paolo 8 years ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: custom fields, page, sorting
-
AuthorPosts
-
October 20, 2017 at 6:09 pm #401801
Hello,
I would like to sort my listings using custom fields to promote specific places.
For example, I have a radio box asking (yes or no) if wi-fi is available for the customers. Can I build a page with just the listings with wi-fi of a particular city? Can you give me an idea on how to implement that?
Thanks!
October 20, 2017 at 7:27 pm #401807Hello!
What you are asking about, GD does through Advanced Search. Our user story for this “Anonymous user is looking for hotels with wifi. The user opens the search options to specify wifi, clicks search, and see the list of hotels in the desired area with wifi.”
Let me give you what I think would be the simplest way to do something you might like. Let’s say your custom field is called ‘wifi’. When ‘wifi’ is shown on a Hotel, it is just text, not a link. The change would be to make ‘wifi’ into a link. What you might do is create a custom function that would turn the display value of ‘wifi’ into a link to the advanced search results for hotels in the same area that have wifi. If Hotel A is in San Francisco, the word ‘wifi’ would show a page for the same latlon near me and have wifi.
The link might look like this: (not a working link) http://www.mySuperSite.com/?geodir_search=1&stype=gd_place&sgeodir_wifi%5B%5D=&s=Hotels
A custom page, is possible and would require more more work. I will point you to a couple of forum requests and docs that discuss custom fields or creating custom pages.
https://wpgeodirectory.com/support/topic/custom-fields-use/
https://wpgeodirectory.com/docs/core-place-settings/#custom
https://wpgeo.directory/rest-api/geodirectory-rest-api-endpoints/
https://wpgeodirectory.com/support/topic/special-offers-page/ (this page describes how a custom page can be made, but is specifically about Special Offers, and working with a custom field would be more difficult.October 21, 2017 at 12:39 am #401843Have a look at https://wpgeodirectory.com/docs/gd-search/
So you would add the wifi custom field to the advanced search, and then your visitors can select to see listings with wifi or no wifi.See here for an example: https://wpgeo.directory/starter/property/
Click on the cogwheel (the last icon).Thanks
October 21, 2017 at 8:03 am #401857Thank you, both for the answer, but that isn’t what I was asking.
I know about the Advanced Search and to build an option to the user filter the results.
My question is a way to build a custom page with that, doing so I have the option to promote that page addressing popular keywords related to the niche of my directory and consequently getting more traffic.
For sure I can do that with categories, but GD architecture makes me use custom fields to set these parameters for my listings. That’s why I’m asking. I’m imagining that such feature it’s common in many directories since it is a very effective way to increase traffic.
Any ideas?
October 21, 2017 at 8:42 am #401859You could create a redirect that redirects /wifi to the search page with those parameters.
There is the [gd-listings] shortcode but it cannot be filtered by custom fields, only tags and categories.
They are the only suggestions I have, anything else would require a customization.
Thanks
October 21, 2017 at 3:29 pm #401895Or you can link directly to the search result pages, there is no easy way with WP to filter archives by custom fields.
Thank you
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket