Limit location dropdown for a specific country only

Let me show you an easy way to limit a country in location search dropdown and address field auto-suggest.

This mod will work only for WordPress themes ClassiPress v4.1.0+, Vantage v4.2.0+ and JobRoller v1.9.0+, which implement the AppMaps Geo framework by AppThemes. The Google Maps is the only supported AppMaps provider for this mod. Means, it will not work with Bing or MapQuest providers.

AppThemes themes implementing AppMaps framework have option "Region Biasing", which limits the country in location dropdown in soft way. It will suggest locations related to the selected country in the first places, but still, allow the other countries options select at the end of the list.

However, if you want to limit the country in strict way, i.e. do not allow to enter any other countries except selected, you would need to add the following code in your theme JS scripts file.

( function( $ ) { $( document ).on( 'appaddressautocompleteready', func…
Read more about Limit location dropdown for a specific country only
  • 0

Replace ClassiPress Location Search field with a custom field dropdown

A detailed instruction on how to replace Location Search field with a custom field dropdown on your WordPress ClassiPress site.

The default ClassiPress search bar has three fields:

Search keywordsLocationCategories

The ClassiPress Location field needs to refine search results to some geographic location. It can use the Google Places API for a location autocomplete and radius search or it may take a simple string to compare against ads address fields.

The following mod replaces default location field with a States dropdown list and allows restricting search results to a specific state.

This method can be applied for any field of the drop-down or checkbox type, such as Country, Region, Size, Color, etc.

The mod should be made in the template file searchform-listing.php, so using a child theme is the preferable way to implement the change.

Create file searchform-listing.php in the root folder of the child theme.Add t…
Read more about Replace ClassiPress Location Search field with a custom field dropdown
  • 6