Shortcode options

You don’t need to manually set shortcode options to get a map on your site – you can do this easily using the shortcode wizard.

In case you do need to manually edit any shortcode options the full range of options available are below:

Normally you shouldn’t need to manually create or edit the shortcode, but if you do, below is a list of all of the available shortcode attributes along with what they do and examples. A few of these haven’t made it into the shortcode wizard yet, and can only be set manually. The default shortcode which shows all locations looks like this:

[maplist simplesearch=”true” locationsperpage=”3″]

Categories

A list of categories (by ID) to show on this map. Leave blank to show all locations.

Default: [empty]

Example:

Categoriesticked

Start with the categories in the dropdown ticked. Some people prefer it this way round in UI terms.

Default: false

Example:

Categoriesaslist

Display the category filter as a list of buttons below the search box. This option really helps if you have a large number of categories to filter by.

Default: false

Example:

categoriesmultiselect

Allow users to selecte multiple categories at the same time.

Default: true

Example:

Categoriesmatchall

Does a location need to match all selected categories to be shown (setting to true makes the selection AND rather than OR).

From 3.10.4

Default: false

Example:

Clustermarkers

Cluster the markers together.

Default: false

Example:

Clustermaxzoomlevel

This option sets how close you have to be before the clustering disappears.

Default: 15

Example:

Clustergridsize

Used to calculate the clustering (normally doesn’t need adjusting).

Default: 50

Example:

Country

Used as a search suffix. This is helpful for when you want to restrict searches to one area.

Default: [empty]

Example:

Daycategorymode

If you create categories named after the days of the week, this will filter the locations to just show locations in the categories matching the current day.

Default: false

Example:

Defaultzoom

This can be used to override the starting zoom level of the map – it only works when used with a fixed starting position (startlatlong). Without this the zoom level will be calculated to show all visible locations.

Default: [empty]

Example:

Defaultdirectionsmode

What mode to use for the directions. Options are DRIVING, BICYCLING, TRANSIT, WALKING.

Default: DRIVING

Example:

disablescroll

Disable the mouse scrollwheel when hovering over the map.

Default: false

Example:

expandsingleresult

If only one location is showing expand it automatically.

Default: true

Example:

Fullpageviewenabled

Enable the View location button on each location. There is also a global setting for this in the settings page.

Default: true

Example:

Geoenabled

Allow the map to automatically find the location of the user.

Default: false

Example:

hideaddress

This hides the address in the list items.

Default: false

Example:

Hidefilter

This hides the category filter button.

Default: false

Example:

hideinfowindow

This hides the infowindows on the map. Clicking locations will still select them in the list if enabled.

Default: false

Example:

hidefilterbar

This hides the all of the sorting, filtering, and search options in one go.

Default: false

Example:

Hidesort” => “false”,

This hides the sort button.

Default: false

Example:

Hidesearch” => “false”,

Hide the search box.

Default: false

Example:

Hidecategoriesonitems

Hide the categories list on each item.

Default: false

Example:

hideuntilsearch

Hides all of the list items until a search is performed.

Default: false

Example:

Hideviewdetailbuttons

Hides the view detail button in the infowindow pop ups on the map.

Default: false

Example:

Homelocationid

Allows you to set one location as the centre of the map. All other locations will then be listed with their distance away from this location.

Default: [empty]

Example:

Infowidth

Sets the width of the infobox as a percentage of the map width at page load.

Default: 70

Example:

Infoheight

Sets the height of the infobox as a percentage of the map height at page load.

Default: 70

Example:

Imageheight

Sets the height of the featured image in px.

Default: 100

Example:

Imagewidth

Sets the width of the featured image in px.

Default: 100

Example:

Initiallyselectedcategories

A comma separated list of category slugs that should start selected when the map loads.

Default: [empty]

Example:

Initialsorttype

How to sort the map initially. Options are title, distance, category (by category order on icon page), categorytitle.

Default: title

Example:

Initialmaptype

What type of map to show initially. Options are ROADMAP, SATELLITE, HYBRID, and TERRAIN.

Default: ROADMAP

Example:

Keepzoomlevel” => false,

This option allows the user to stay zoomed in after selecting a location. Normally the map zoom back put when the location list item of infowindow is closed.

Default: false

Example:

Locationsperpage

How many locations to show on each page in the list.

Default: 3

Example:

Locationstoshow

A list of location id’s to show on the map/list.

Default: [empty]

Example:

Limitresults

This option restricts the number of locations that are shown to a user at any point. It can be used to just show the nearest X locations from a users location when used in conjunction with the geoenabled option.

Default: -1

Example:

Maximumposts

By default Map List Pro limits the number of locations retrieved from the database for a single map to 2000. This can be increased by specifying a limit, or the limit can be removed by setting this to -1.

Default: 2000

Example:

Mapposition

Where the map should sit in relation to the list. Options are above, leftmap, or rightmap.

Default: above

Example:

menushideonselect

Make the sort and category menus hide after an item is selected

Default: true

Example:

Openinnew

Should the view detail buttons open in a new window.

Default: false

Example:

Selectedzoomlevel

What zoom level to use when clicking on a location.

Default: [empty]

Example:

Searchdistances

This allows you to edit the dropdown list of distances that are used for filtering on location enabled searches.

Default: 10,15,20,25,30,35

Example:

Showdirections

Allows you to show/hide the directions field in locations.

Default: true

Example:

Showthumbnailicon

Enabling this option makes the featured image on the location get used in place of the small map icon.

Default: false

Example:

Simplesearch

Set the search mode to use. Options are true (text only search), false (location based search), and combo (text and location search).

Default: false

Example:

Startlatlong

The starting centrepoint for the map entered as latitude and longitude separated by a comma. To use this option you will also need to set the default zoom level for the map (defaultzoom). Lat/lng should be entered in decimal format.

Default: false

Example:

Sortcategoriesby

This lets you set the ordering of the categories in the dropdown. “Manual” lets you set the order by dragging and dropping the categories on the category icons page to set the preferred order.

Default: title

Example:

Streetview

Lets you turn streetview on or off on a map.

Default: true

Example:

Usealltaxonomies

From version 3.6.0

Adds a filter to the front end for every taxonomy added to the maplist post type. To add additional taxonomies use code like this in your theme’s functions.php:

 

Default: false

Example:

Viewstyle

Changes how the map and list is displayed. Options are “both” (show the map and list), “listonly” (only show the list), “maponly” (only show the map), and accordion (show the map and list, with the list in an accordion grouped by category).

Default: both

Example:

From version 3.7

SmartRedFox has written 30 articles