Installation
Install and activate
Assuming you already have Directory installed, Location Manager should be installed as well. However, if you want to install just this particular plugin, follow these instructions.
- Connect to member area and under “Plugin Downloads” section download the Tevolution – Location Manager Plugin to your hard drive.
- Navigate to wp-admin -> Plugins -> Add New -> Upload and upload the downloaded zip file.
- Activate the plugin once the upload process is completed.
If you run into problems with the above method (the file cannot be uploaded), extract the zip file, connect to your server via FTP and upload the Tevolution-LocationManager folder to /wp-content/plugins directory
The purpose of Location Manager
In short, Location Manager is the component that enables the city functionality inside Directory. Here’s some basic information about that plugin, i.e. the things you should know before you commit to using it…
- Despite the fact location management is divided into three levels (countries, states and cities), only cities are interactive. In other words, you can’t “visit” a specific country or state, just cities within those countries and states.
- Cities are essentially listing filters. Simply put, listings from one city won’t show in the other one.
- Location Manager increases page load times because all content must be constantly filtered by cities as well as other parameters. Don’t use the plugin if you don’t really need it. For example, if the area you’re covering with your directory is really small, there is no real need to filter content by cities since content from one city might be interesting to residents of a nearby city.
- Always be aware of the city you’re “in”. If the listing you just added isn’t displaying on the homepage (or category page), check your current city. It’s possible you added the listing inside a city different than the one you’re currently “visiting”.
Settings & Setup
General Settings
The majority of Location Manager settings are available from Tevolution ⇨ Manage Locations. Here’s a list of options available in that area…
City selector style
This option defines the look of the city selector available inside your theme header (usually the top left corner). Here’s how they look in the front-end.
City selector levels
The option you choose here will affect both the city selector and the multi city field inside your submission forms. In other words, if you select the “Only Cities” option visitors won’t be required to input the country and state while submitting listings.
The city selector dropdown that appears in the header of the homepage can be managed by navigating to Tevolution >> Manage Locations.
City Selectory style: From here you can choose whether you want to see a dropdown selector or links for the city.
City selector levels: The city selector levels lets you decide the level of selection.
All counties: Displays a 3-level city selector Country > State > City with ability to change country. This can be used when you are creating a global directory and want the user to select the country first and then the state and city of that country.
One Country: Displays a 2-level city selector State > City without ability to change country. It allows to select the state and the city only. This can be used when the website is based for a particular country only.
Only Cities: Displays a 1-level city selector without countries or states. This will display all the cities and the user has to select one from it.
Is it possible to change the country > state > city hierarchy?
It’s not easy, but yes, it’s possible. For example, let’s imagine you want to change the hierarchy levels to city > neighborhood. Here’s how you do it:
- Inside the “City selector levels” option select “One Country”.
- Go to Manage Locations ⇨ States (tab) and add your city as a state. For example, create a new state called “Los Angeles”.
- Go to Manage Locations ⇨ Cities (tab) and add your neighborhood as a city. Instead of entering the city name as “Los Angeles”, instead enter “Beverly Hills”. Adjust the pin on the map if necessary.
- Open the en_US.po language file (click here for a tutorial).
- Translate all necessary instances of the word “state” into “city”.
- Translate all necessary instances of the word “city” into “neighborhood”.
If you did everything correctly you should now have a two-level hierarchy with cities and neighborhoods.
Location Tracking Method
Location Manager has an IP tracker built-in that allows your theme to pinpoint the visitors location. The “Location Tracking Method” option allows you define the service that will be used for this. I recommend you change this only if you’re experiencing problems with the default (Freegeoip) option.
To enable the MaxMind option follow these steps
- Download this zip file.
- Extract the file using software like 7-Zip.
- Connect to your server with FTP. Click here for a tutorial if you haven’t done it before.
- Place the contents of the zip file inside the /wp-content/plugins/Tevolution-LocationManager/ folder on your server.
- Enable the “MaxMind” option inside Tevolution ⇨ Manage Locations.
Homepage Displays
Choose what happens when visitors come to your site.
Default city – displays your default city. You can set the default city from the Cities tab.
Ask to show nearest city – upon arrival visitors will see a strip at the top asking them to share their location.
Nearest city – visitors will be taken to the city nearest to them without the ability to stop the process.
Activate location management for
The multi-city functionality will only be active for post types selected here. If you want blog posts to show inside all cities don’t check the “Post” box.
Note: New post types that you create and those enabled by add-ons (e.g. Events or Properties) won’t be automatically selected here. You will have to enable location management for them manually.
Turn the city logs on or off
Enable this if you want to see how visits are distributed across your cities. City log information is available from Tevolution ⇨ Manage Locations ⇨ City Logs (tab).
You can turn the city logs on or off, by navigating to Tevolution >> Manage locations >> Track city visits (city logs). When the option is enabled the City logs tab will be shown at Tevolution >> Manage Locations, else it will disappear.
Where to view the city logs?
The city logs for each city is available at Tevolution >> Manage locations >> City logs.
With this feature you can determine which is the most popular city on your website. You can also check the cities where there are minimum visits and work on their listings or populate them with more listings. The main advantage with this feature is that you can get a report of your site performance based on cities.
The city logs page
The city log will show how many times a city is selected and its listings are viewed. The report will show the city, state and the country name with the Total Count and view details. On clicking on views – the details of the city views will be shown. This includes the IP address and number of times the city is viewed from the IP address. This page will contain all the IP addresses that has accessed the city.
Use
Suppose there’s a Directory website for a bank, example : HDFC bank, so the listings shows the location of the bank offices and the atm machines of the bank at different locations in the country. The city logs can be observed from the backend of the website to find out in which parts of the country are people searching more for the bank. This result can be used to draw several conclusions and designing strategy for the business.
How to set the Location focus?
This can be managed from Tevolution >> Manage Locations >> Locations >> Homepage displays. There are three options available for this :
Default city : This will show the listings of the default city selected by you to your users. You can set the default city by navigating to Tevolution >> Manage Locations >> Cities >> hovering over the city name and selecting the “Set Default”.
Ask to show nearest city : Asks visitors to share their location and if they agree, they are shown their nearest city. If visitor doesnt share location, listings from the default city will be displayed.
Nearest city : Show listings from the city nearest to the visitors without asking to share their location. Note: Your cities must have atleast one listing added to get tracked as nearest city in front end.
Use
You have a global directory for the Oil plants of a particular company across the world. The company basically belongs to Abu Dhabi and most of its plants are situated there. So you can set the location focus for the default city Abu Dhabi, as majority of listings are in that area.
Add a city
To add your own city navigate to Tevolution ⇨ Manage Locations ⇨ Cities (tab) ⇨ Add new city.
Country & State
Choose the country and state appropriate for the city you’re adding. In case the country or state isn’t available, you can add a new one from the Country and/or State tab.
Map Type
Set the type of your map. If you want to add some flair to your maps consider getting the Map Customizer add-on.
Map Scaling Factor
Choose how much of the map to show. 1 displays the whole globe while 19 shows a specific house. An appropriate level for a city is around 13.
City Name
This is the most important field inside the whole form. By entering a value you are setting both the name of the city and its location. As soon as you stop typing your city name the little map will zoom on it. Feel free to move the pin in order to better define the location of your city.
City latitude and longitude
These two fields are populated automatically as soon as you enter a value inside the “City Name” field. They will also be automatically updated if you move the pin around (inside the small map).
Homepage / Category page map display
These settings let you control the behavior of the map. If you want to show all available listings at all times be sure to select the “Fit all available listings” option. If you want to respect the zoom level set under “Map Scaling Factor”, choose that option.
Post Type & Categories
Choose the post types and categories that you plan on showcasing in this city. Selected post types and categories will appear inside the homepage map.
City Message
Write a city description that you can display when visitors are browsing that particular city. To actually show the description enter the following shortcode inside a regular “Text” widget.
[city_message]
Background Color and Background Image
Choose a color by clicking on the input field and using the color picker. Set a background image by clicking on Browse, uploading an image and then clicking on “Set as background image” in the bottom right corner. Ideal image size is 1920 pixels. The area affected by both the color and image is the area on the left and right side of the container. Example.
Note: The changes you make here will override those inside Appearance ⇨ Customizer. Also, if you set both a background color and a background image, the image will have priority.
Header Background Color and Image
Choose a color by clicking on the input field and using the color picker. Set a header background image by clicking on Browse, uploading an image and then clicking on “Set as header image” in the bottom right corner. Ideal image size is 1240 pixels. The area affected by both the color and image is the area usually populated with the logo and the search bar. Example.
Note: The changes you make here will override those inside Appearance ⇨ Customizer. Also, if you set both a header background color and a header background image, the image will have priority.
Add countries & states
You can add new countries and states from the “Countries” and “States” tabs inside the Tevolution ⇨ Manage Locations section. Most world countries are already added so you don’t really have to add them manually. However, if you do commit to that, make sure to add countries first since you’re required to select a country while adding a state.
Map Shortcode
Use the below shortcode to display content (one or most post types) within a specific city. To create a page using this shortcode navigate to Pages ⇨ Add New and paste in the code.
[TCITY-DIRECTORYMAP cityid='1' post_type='listing' height='500'][/TCITY-DIRECTORYMAP]
cityid – the ID of the city you want to show. The city ID is displayed when hovering over a city inside Manage Locations ⇨ Cities (tab). Screenshot.
post_type – enter the post type you want to show (e.g. listing, event, property, etc). To display multiple post types separate them with a comma. For example, to display listings and properties, enter the value like this: ‘listing,property’.
height – enter the map height in pixels.
Bulk upload cities
To use this functionality you’ll first need to install the optional (and free) Bulk Import/Export plugin. Here are the installation steps…
- Download the Bulk Import/Export extension.
- Navigate to Plugins ⇨ Add New ⇨ Upload and load the downloaded zip file. Activate the plugin once the installation is complete.
- To start using the plugin navigate to Tevolution ⇨ Bulk Import/Export.
- To bulk upload city focus on the CSV City Import section
How to bulk upload cities?
Start by downloading the sample CSV file available at the bottom of the CSV City Import section. The content you add must match the structure inside that file. To actually edit the CSV you’ll need a text editor like Notepad++, or even better, Microsoft Excel. For general tips on editing CSV files open the Bulk Upload section of our Tevolution guide.
Download user-generated city CSVs from this article. These are bulk upload files that other members created. There are cities available for US, UK, Canada, Spain and more. Visit this link.
Are you using WPEngine as your host?
Precautions if you are using a Tevolution-Locationmanager multicity along with the WPEngine.
Tevolution-LocationManager plugin uses PHP sessions for city management. WPEngine doesn’t support sessions at all. So city selector in header might not work properly if we are browsing a site contents front end. Sometimes site may under-perform because of certain limitations that WPEngine enforces on their server.
In general they are an insanely fast host. However, they aren’t suitable for every theme specifically if the functionality is rely upon sessions because they do not allow session variables on their servers.
If you are facing any issue with city selector and using WPEngine as your host, please try to check the same issue on any other hosting server or your localhost.