Title: Support for post type
Last modified: September 15, 2016

---

# Support for post type

 *  [bruinkid](https://wordpress.org/support/users/bruinkid/)
 * (@bruinkid)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/support-for-post-type/)
 * Hi,
 * If I have a post type ‘restaurant’, with coordinate ‘address’, ‘city’, ‘zip code’,
   I can also use your plugin to find restaurants, right?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/support-for-post-type/#post-8185299)
 * You can use it to find whatever you want, as long as the data is entered in the
   store locator itself. If you want to use a different source ( post type ), then
   you will have to make some changes in the code for that to work, and ( this is
   likely the problem ), have the coordinates available as well. Without the coordinates
   you can’t make a search.
 * What happens is that a user on the front-end fills in a location, that location
   is turned into a set of coordinates, and the DB is search for other coordinates
   that fall within the set radius. So without the restaurant coordinates, it’s 
   not possible to search for anything.
 * I don’t have time to test it out, but I can point you in the right directions.
   The main thing is the query that searches for nearby locations once a users started
   a search. The [SQL](https://plugins.trac.wordpress.org/browser/wp-store-locator/tags/2.2.4/frontend/class-frontend.php#L249)
   query by default uses the ‘wpsl_stores’ custom post type, instead of ‘restaurant’.
   This can be changed with the [wpsl_sql](https://wpstorelocator.co/document/wpsl_sql/)
   filter, but you will also have to make sure the correct meta fields are used 
   to get the coordinates for of the restaurants.
 * So maybe it’s easier to move the locations details from the restaurants in the
   WPSL plugin itself, instead of making the code modifications to make it work 
   with another custom post type?
 *  Thread Starter [bruinkid](https://wordpress.org/support/users/bruinkid/)
 * (@bruinkid)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/support-for-post-type/#post-8185472)
 * I can see what you are saying. This might work if post type is ‘restaurant’. 
   But this can’t work if our post type is ‘house’ and we have other search criteria
   filter after this search as first step search in homepage. Basically the SQL 
   query use coordinates like wpsl_zip and wpsl_address . How can we change that
   to our own coordinate name like house_zip and house_address?
 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/support-for-post-type/#post-8189595)
 * > Basically the SQL query use coordinates like wpsl_zip and wpsl_address . How
   > can we change that to our own coordinate name like house_zip and house_address?
 * The fields that are used are _wpsl\_lat_ and _wpsl\_lng_, if you rename those
   fields in the query to the fields you want to use that fold the coordinates, 
   then it should work.
 * I never tried it myself, but instead if `WHERE posts.post_type = 'wpsl_stores'`
   you should be able to make it go through both the ‘restaurant’ and ‘house’ custom
   post type, but this will probably turn into a complicated query, since you will
   also need to make sure it goes through both meta fields holding the coordinates
   for both post types.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Support for post type’ is closed to new replies.

 * ![](https://ps.w.org/wp-store-locator/assets/icon-256x256.jpg?rev=1007784)
 * [WP Store Locator](https://wordpress.org/plugins/wp-store-locator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-store-locator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-store-locator/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-store-locator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-store-locator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-store-locator/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/support-for-post-type/#post-8189595)
 * Status: not resolved