1. Home
  2. Docs
  3. Shortcodes
  4. Shortcodes
  5. Single Location

Single Location

You can display all listings of a single location using the following shortcode. Remember, if you visit the page after adding this shortcode directly, you will see something like this ‘No Results Found.’ message. It is because the Directorist plugin will use the page with this shortcode to display all listings of a specific location dynamically when a user clicks on a single location anywhere on your website. In other words, this page is not for direct access so it is better not to include the page with this shortcode in the nav menu.

Single Location: [directorist_location]

The [directorist_location] shortcode has a number of parameters to customize the output. Let’s have a look at the available parameters and their available values with some description.

Attributes/Parameters:

  1. view: You can display all listings of a location in a list, grid and map layout. Available Options: list,grid and map view. The default value is grid. Example: [directorist_location view=”grid”]
  2. orderby : You can order all listings of a location using this parameter. Options available : title, date & price. The default is date. Example: [directorist_location orderby=”date”].
  3. order: You can sort all listings of a location in ascending or descending order. Options available: asc | desc. The default is asc. Example: [directorist_location order=”asc”].
  4. logged_in_user_only: You can make single location page only visible for logged in user using this parameter. Options available: yes | no. Example: [directorist_location logged_in_user_only=”no”].
  5. redirect_page_url: Forward/redirect single location page using this parameter. Example: [directorist_location redirect_page_url=”www.aazztech.com”].
  6. listings_per_page: You can set the number of listing to show per page using this parameter. The default is 6. Example: [directorist_location listings_per_page=”6″].
  7. header: You can show/hide header area using this attributes. Options available: yes | no. Example: [directorist_location header=”yes”]
  8. header_title: You can customize header title using this parameter. For example [directorist_location header_title=”Total Listing Found: “]
  9. columns: You can set the number of columns of the grid view layout using this attribute. Example [directorist_location columns=”3″]
  10. show_pagination: You can show/hide pagination. Available options: yes|no. Example [directorist_location show_pagination=”yes”]
  11. map_height: You can customize the height of the map view layout using this attribute. Example [directorist_location map_height=”350″]

 

 

Bonus tips: Suppose your single location page URL is like this (https://yourwebsite.com/single-location-page-url) and you have two locations New York and London. Then you can display/view all listings in New York by visiting https://yourwebsite.com/single-location-page-url/new-york and view all listings/cars in London by visiting https://yourwebsite.com/single-location-page-url/london. Now you may have noticed how this single location page works dynamically. So basically it works like this. https://yourwebsite.com/single-location-page-url/{location_name}