Home » Shortcodes

Shortcodes

Below are the shortcodes available with the plugin. Note that we do not recommend using these shortcodes multiple times on a single page or use them within a widget.

[sabai-directory]

Displays listings from one or more directories in list or map view with a search box, sorting options and pagination. Here are the attributes available for this shortcode:

  • addon: When set, the settings of the specified add-on will be used as the default settings of this shortcode (default: if addons is set, the first value specified, otherwise “Directory”).
  • perpage: The number of listings to display per page.
  • sort: The default sorting order, one of “newest”, “oldest”, “reviews”, “rating”, “distance”, “random”, or “title”.
  • view: The default view mode, “list”, “map”, or “grid”.
  • zoom: The default zoom level of map. Note that this will only apply when there is only 1 listing to be displayed. Otherwise, the zoom level is calculated automatically so that all listings fit within the map.
  • distance: The default search radius. Set this to “0” for dynamic calculation based on the address being searched.
  • is_mile: Whether or not the value of distance is in mile, “0” or “1”.
  • address: Display listings located near this address (default: none).
  • map_height: The height of the map in pixels, when in Map view.
  • map_type: The type of the map to display, one of “roadmap”, “satellite”, “hybrid”, or “osm”.
  • list_map_show: Whether or not to display a small map in List view, “0” or “1”.
  • list_map_height: The height of the map in pixels, when in List view (default: the value of map_height).
  • scroll_list: Show a scroll bar when there are many listings to display in List view, “0” or “1”. This is valid only when “list_map_show” is “1”.
  • hide_searchbox: Hide the search box form, “0” or “1” (default: “0”).
  • hide_nav: Hide the navigation bar, “0” or “1” (default: “0”).
  • hide_nav_views: Hide the view switcher, “0” or “1” (default: “0”). Note this will have no effect if hide_nav is “1”.
  • hide_pager: Hide the page navigation at the bottom, “0” or “1” (default: “0”).
  • featured_only: Show featured listings only, “0” or “1” (default: “0”).
  • feature: Make featured listings sticky, “0” or “1” (default: “1”).
  • geolocate: Use geolocation API to get the current user’s location and display nearby listings, “0” or “1” (default: “0”). This should be used in conjunction with the distance attribute for better search results.
  • addons: If there are multiple directories, use this parameter to display listings from specific directories only. This must be add-on names (case sensitive) separated by commas (default: none).
  • category: Display listings that belong to this category and its descendant categories (default: none). The value must be a valid category slug. If there are multiple directories, use the addons attribute to specify the directory to which the category belongs, otherwise the default directory will be used.
  • user_id: When this parameter is set, then only the listings claimed or authored (and unclaimed) by the user will be shown (default: none).
  • user_name: When this parameter is set, then only the listings claimed or authored (and unclaimed) by the user will be shown (default: none, overrides: user_id).
  • keywords: Show listings containing keyword(s) specified with this parameter
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example | Example (with Geolocation)

[sabai-directory-listings]

Displays listings from one or more directories in list view with optional sorting options and pagination. This shortcode is essentially the same as the [sabai-directory] but without the searchbox and any options to display the map. Here are the attributes available for this shortcode:

  • addon: When set, the settings of the specified add-on will be used as the default settings of this shortcode (default: if addons is set, the first value specified, otherwise “Directory”).
  • perpage: The number of listings to display per page.
  • sort: The default sorting order, one of “newest”, “oldest”, “reviews”, “rating”, “distance”, “random”, or “title”.
  • distance: The default search radius. Set this to “0” for dynamic calculation based on the address being searched.
  • is_mile: Whether or not the value of distance is in mile, “0” or “1”.
  • address: Display listings located near this address (default: none).
  • hide_nav: Hide the navigation bar, “0” or “1” (default: “0”).
  • hide_pager: Hide the page navigation at the bottom, “0” or “1” (default: “0”).
  • featured_only: Show featured listings only, “0” or “1” (default: “0”).
  • feature: Make featured listings sticky, “0” or “1” (default: “1”).
  • geolocate: Use geolocation API to get the current user’s location and display nearby listings, “0” or “1” (default: “0”). This should be used in conjunction with the distance attribute for better search results.
  • addons: If there are multiple directories, use this parameter to display listings from specific directories only. This must be add-on names (case sensitive) separated by commas (default: none).
  • category: Display listings that belong to this category and its descendant categories (default: none). The value must be a valid category slug. If there are multiple directories, use the addons attribute to specify the directory to which the category belongs, otherwise the default directory will be used.
  • user_id: When this parameter is set, then only the listings claimed or authored (and unclaimed) by the user will be shown (default: none).
  • user_name: When this parameter is set, then only the listings claimed or authored (and unclaimed) by the user will be shown (default: none, overrides: user_id).
  • keywords: Show listings containing keyword(s) specified with this parameter
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-directory-slider]

Displays listings from one or more directories in a slider:

  • addon: When set, the settings of the specified add-on will be used as the default settings of this shortcode (default: if addons is set, the first value specified, otherwise “Directory”).
  • perpage: The number of listings to display.
  • sort: The default sorting order, one of “newest”, “oldest”, “reviews”, “rating”, “distance”, “random”, or “title”.
  • distance: The default search radius. Set this to “0” for dynamic calculation based on the address being searched.
  • is_mile: Whether or not the value of distance is in mile, “0” or “1”.
  • address: Display listings located near this address (default: none).
  • hide_nav: Hide the navigation bar, “0” or “1” (default: “1”).
  • featured_only: Show featured listings only, “0” or “1” (default: “0”).
  • feature: Display featured listings first, “0” or “1” (default: “1”).
  • addons: If you have created multiple directories by cloning the Directory add-on, use this parameter to display listings from specific directories only. This must be add-on names (case sensitive) separated by commas (default: none).
  • category: Display listings that belong to this category and its descendant categories (default: none). The value must be a valid category slug. If there are multiple directories, use the addons attribute to specify the directory to which the category belongs, otherwise the default directory will be used.
  • slider_speed: Slide transition duration in milliseconds (default: “4000”).
  • slider_mode: Type of transition between slides, one of “horizontal”, “vertical”, or “fade” (default: “horizontal”).
  • slider_auto: Whether or not to automatically start the slider, “0” or “1” (default: “1”).
  • slider_height: The height of the slider in pixels (default: none).
  • slider_controls: Whether or not to display previous/next buttons, “0” or “1” (default: “1”).
  • slider_pager: Whether or not to display pager, “0” or “1” (default: “1”).
  • slider_border: Whether or not to display border around the slider, “0” or “1” (default: “0”).
  • with_photo_only: Whether or not to display listings with one or more photos only, “0” or “1” (default: “0”).
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-directory-photo-slider]

Displays listings from one or more directories in a slider:

  • addon: When set, the settings of the specified add-on will be used as the default settings of this shortcode (default: if addons is set, the first value specified, otherwise “Directory”).
  • perpage: The number of listings to display per page.
  • sort: The default sorting order, one of “newest”, “oldest”, “reviews”, “rating”, “distance”, “random”, or “title”.
  • distance: The default search radius. Set this to “0” for dynamic calculation based on the address being searched.
  • is_mile: Whether or not the value of distance is in mile, “0” or “1”.
  • address: Display listings located near this address (default: none).
  • hide_nav: Hide the navigation bar, “0” or “1” (default: “1”).
  • featured_only: Show featured listings only, “0” or “1” (default: “0”).
  • feature: Display featured listings first, “0” or “1” (default: “1”).
  • addons: If you have created multiple directories by cloning the Directory add-on, use this parameter to display listings from specific directories only. This must be add-on names (case sensitive) separated by commas (default: none).
  • category: Display listings that belong to this category and its descendant categories (default: none). The value must be a valid category slug. If there are multiple directories, use the addons attribute to specify the directory to which the category belongs, otherwise the default directory will be used.
  • photo_size: Photo size in each slide, one of “thumbnail”, “medium”, “large”, or “original” (default: “large”).
  • with_photo_only: Whether or not to display listings with one or more photos only, “0” or “1” (default: “0”).
  • slider_speed: Slide transition duration in milliseconds (default: “4000”).
  • slider_mode: Type of transition between slides, one of “horizontal”, “vertical”, or “fade” (default: “horizontal”).
  • slider_auto: Whether or not to automatically start the slider, “0” or “1” (default: “1”).
  • slider_height: The height of the slider in pixels (default: none).
  • slider_controls: Whether or not to display previous/next buttons, “0” or “1” (default: “1”).
  • slider_pager: Whether or not to display pager, “0” or “1” (default: “1”).
  • slider_border: Whether or not to display border around the slider, “0” or “1” (default: “0”).
  • slider_captions: Whether or not to display image captions, “0” or “1” (default: “1”).
  • slider_slide_margin: Margin between slides in pixels (default: 10).
  • slider_slide_width: Width of each slide in pixels (default: calculated automatically based on the value of “photo_size”). Use this if the default does not display sliders properly.
  • slider_slide_height: Height of each slide in pixels (default: calculated automatically based on the value of “photo_size”). Use this if the default does not display sliders properly.
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-directory-map]

Displays a map of listings from one or more directories. Here are the attributes available for this shortcode:

  • num: The number of listings to display on map (default: “10”).
  • sort: The default sorting order, one of “newest”, “reviews”, “rating”, “distance”, “random”, or “title” (default: “newest”).
  • zoom: The default zoom level of map (default: “15”). Note that this will only apply when there is only 1 listing to be displayed. Otherwise, the zoom level is calculated automatically so that all listings fit within the map.
  • distance: The default search radius (default: “10”).
  • is_mile: Whether or not the value of distance is in mile, “0” or “1” (default: “0”).
  • address: Display listings located near this address (default: none).
  • height: The height of the map in pixels (default: “400”).
  • style: The name of custom map style, one of “Red”, “Blue”, “Greyscale”, “Sepia”, “Mixed”, “Chilled”, or “Night” (default: none).
  • marker_clusters: Whether or not to enable clustered markers, “0” or “1” (default: “1”).
  • addons: If you have created multiple directories by cloning the Directory add-on, use this parameter to display listings from specific directories only. This must be add-on names (case sensitive) separated by commas (default: none).
  • category: Display listings that belong to this category and its descendant categories (default: none). The value must be a valid category slug. If there are multiple directories, use the addons attribute to specify the directory to which the category belongs, otherwise the default directory will be used.
  • user_id: When this parameter is set, then only the photos submitted by the user will be shown (default: none).
  • user_name: When this parameter is set, then only the listings claimed or authored (and unclaimed) by the user will be shown (default: none, overrides: user_id).
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-directory-categories]

Displays a list of categories from one or more directories. Here are the attributes available for this shortcode:

  • addons: If you have created multiple directories by cloning the Directory add-on, use this parameter to display categories from specific directories only. This must be add-on names (case sensitive) separated by commas (default: none).
  • columns: The number of columns of the category listing, one of either “1”, “2”, “3”, or “4” (default: “2”).
  • hide_children: Hide all child categories, “0” or “1” (default: “0”).
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-directory-reviews]

Displays reviews from one or more directories in list view with optional sorting options and pagination. Here are the attributes available for this shortcode:

  • hide_nav: Hide the navigation bar, “0” or “1” (default: “0”).
  • hide_pager: Hide the page navigation at the bottom, “0” or “1” (default: “0”).
  • addons: If you have created multiple directories by cloning the Directory add-on, use this parameter to display reviews from specific directories only, otherwise reviews from all add-ons will be shown. This must be add-on names (case sensitive) separated by commas (default: none).
  • user_id: When this parameter is set, then only the reviews submitted by the user will be shown (default: none).
  • user_name: When this parameter is set, then only the listings claimed or authored (and unclaimed) by the user will be shown (default: none, overrides: user_id).
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-directory-photos]

Displays photos from one or more directories in list view with optional sorting options and pagination. Here are the attributes available for this shortcode:

  • hide_nav: Hide the navigation bar, “0” or “1” (default: “0”).
  • hide_pager: Hide the page navigation at the bottom, “0” or “1” (default: “0”).
  • addons: If you have created multiple directories by cloning the Directory add-on, use this parameter to display photos from specific directories only, otherwise photos from all add-ons will be shown. This must be add-on names (case sensitive) separated by commas (default: none).
  • user_id: When this parameter is set, then only the photos submitted by the user will be shown (default: none).
  • user_name: When this parameter is set, then only the listings claimed or authored (and unclaimed) by the user will be shown (default: none, overrides: user_id).
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-directory-listing]

Displays a single listing in detailed view.

  • id: ID of the listing to display.
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-directory-search-form]

Displays a search listings form. Here are the attributes available for this shortcode:

  • addon: If you have created multiple directories by cloning the Directory add-on, use this parameter in order to specify to which directory the search form will be submitted. If no value is given, then it will be submitted to the default directory. This must be a valid add-on name (case sensitive, default: none).
  • page: Use this parameter to specify the page to which the search form will be submitted. This can be either the slug (path) or the ID of the page. Make sure that the content of the page contains a directory created by the [sabai-directory] shortcode. If this parameter is set, the addon paramter will be ignored.
  • no_key: Add this parameter with its value set to “1” to hide the input keyword field in the search form.
  • no_loc: Add this parameter with its value set to “1” to hide the input location field in the search form.
  • no_cat: Add this parameter with its value set to “1” to hide the category dropdown field in the search form.
  • button: Use this parameter to specify the color of the button to display, one of either “sabai-btn-primary”, “sabai-btn-success”, “sabai-btn-danger”, “sabai-btn-warning”, or “sabai-btn-inverse” (default: none).
  • mini: Setting this to “1” will then render all fields in the form 100% width. This is great for displaying the form in the sidebar for example, where the space for displaying the form is limited (default: 0).
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-directory-add-listing-button]

Displays an add listing button. Here are the attributes available for this shortcode:

  • addon: If you have created multiple directories by cloning the Directory add-on, use this parameter in order to specify to which directory the search form will be submitted. If no value is given, then it will be submitted to the default directory. This must be a valid add-on name (case sensitive, default: none).
  • size: Use this parameter to specify the size of the button, one of either “xs”, “sm”, or “lg” (default: none).
  • type: Use this parameter to specify the type of the button to display, one of either “primary”, “success”, “danger”, “warning”, or “inverse” (default: none).
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-directory-pricing-table]

Displays a pricing table. Here are the attributes available for this shortcode:

  • addon: If you have created multiple directories by cloning the Directory add-on, use this parameter in order to specify which directory plans should be displayed. If no value is given, then payment plans created for the default Directory add-on are displayed. This must be a valid add-on name (case sensitive, default: none).
  • columns: Number of columns of the pricing table, one of either 1, 2, 3, 4, 6, 12 (default: 3).
  • payment_type: One or more payment types separated by commas. Plans with these payment types will be displayed in the pricing table. Valid values are: 1, w, m, 3m, 6m, y (default: 1).
  • link_others: Whether or not to add links to other payment types as dropdown links to the order button, 0 or 1 (default: none).
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Examples