Code

How do I display Google Maps place rating and r...

« See all FAQs for Directories Pro - Directory plugin for WordPress

How do I display Google Maps place rating and review count or opening hours for each listing?

Make sure “Google Maps” and “Google Maps Place Details” are selected for the “Map provider” and “Places API” settings respectively, in Directories -> Settings -> Map -> Map API Settings, and both the server and browser API keys are configured as instructed in the documentation (https://directoriespro.com/documentation/getting-started/installation.html#obtaining-a-google-maps-api-key). Also make sure the “Places API” library is enabled for your API project on Google API console if not yet enabled.

Go to Directories -> [Your Directory] -> Content Types -> Listing -> Manage Fields and create a “Single Line Text” field and select “Must be a valid Google Maps place ID” for the “Character validation” setting. Then, create a display element for the field from Directories -> [Your Directory] -> Content Types -> Listing -> Manage Displays with the “Field renderer” setting to “Google Maps place details”, and select “Rating” or “Opening Hours”.

You must enter a valid Google Maps place ID into the field that you created when you add/edit listings. You can find the Google Maps place ID here: https://developers.google.com/maps/documentation/javascript/examples/places-placeid-finder

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey