WordPress Plugin
Last updated: September 23, 2022
The FareHarbor for WordPress plugin adds shortcodes that make it easy to add booking calendars and buttons to your site. It also seamlessly adds the Lightframe API and the FareHarbor Stylesheet to your site.
Important: Our WordPress plugin requires a FareHarbor account to work – but you don’t need to be using WordPress to use FareHarbor. Not using FareHarbor yet? Watch a short video and get in touch with us.
How to install
From inside of WordPress (recommended):
- Navigate to your WordPress Dashboard
- From the sidebar, choose Plugins, then Add New
- Search for FareHarbor
- Click Install for the “FareHarbor for WordPress” plugin
- Activate the plugin
By direct upload:
- Download the most recent version of the plugin and unzip it.
- Upload the
fareharbor
folder to your/wp-content/plugins/
directory - Activate the plugin through the ‘Plugins’ menu in WordPress
Configuring the Lightframe and Stylesheet
In order to add the Lightframe API to your wordpress site, navigate to the plugin settings and check the box for Enable auto Lightframing:
Learn how to configure the FareHarbor Stylesheet using the Wordpress plugin
Using the shortcodes
The plugin adds several shortcodes that are available for use on posts and pages. Since shortcodes are text, you can edit them with either the Visual or Text options in WordPress.
Tip: If you don’t want to write out shortname="companyname"
each time you enter a shortcode, you can set it as a default option.
[fareharbor] shortcode
The [fareharbor] shortcode inserts an availability calendar into the page. For example, this will insert a calendar for item 500 from companyname:
[fareharbor shortname="companyname" items="500"]
[itemgrid] shortcode
The [itemgrid] shortcode inserts a grid of items into the page. The grid can include all items or a specific flow. For example, this will insert the items in flow 500 from companyname:
[itemgrid shortname="companyname" flow="500"]
[lightframe][/lightframe] shortcode
The [lightframe] shortcode uses our Lightframe Javascript API to open the Lightframe booking overlay when any text or button of your choosing is clicked. To use, wrap the opening and closing shortcodes around some content. For example, this will make the words “Book now!” open a booking overlay for all of companyname’s items:
[lightframe shortname="companyname"]Book now![/lightframe]
[partners] shortcode
The [partners] shortcode allows inserting of an embed linking to partner companies. The “include” option specifying shortnames of which companies should be included is required:
[partners shortname="companyname" include="shortname1, sn2"]
Available options
The following options are available for all shortcodes. Some of these options can be set as defaults if you don’t want to enter them every time.
shortname="companyname"
: Your company’s FareHarbor shortname. This is the only option that is required for all 4 shortcodes.items="100,105"
: IDs of the items that should be included. If no items are provided, a calendar of all your items will be displayed. f you wish to include more than one item, it is recommended to build out a flow on your Dashboard and link the specific flow (Note:items
is not available for the [partners] shortcode.)sheet="1234"
: (depreciated, but supported) The price sheet that should be used while creating bookings.sheet_uuid="daeab943-444d-40bb-b316-747c0b20be96"
: The unique identifier for the price sheet that should be used while creating bookings.schedule="1234"
: The price schedule that should be used while creating bookings. If both sheet and schedule are set, the sheet will be used.full_items="yes"
: Should the Lightframe that is opened include item descriptions and photos? Set to yes or no; defaults to no.asn="partnername"
: The shortname of your partner company, if you are using the ASN network.asn_ref="Custom ASN Ref"
: The voucher number that should be set for ASN bookings.ref="Custom Ref"
: The online booking reference that should be set for bookings.flow="4321"
: Determines which flow to use for setting the breadcrumbs at the top of the booking process.language="es"
: The two letter code for the language that FareHarbor pages should be overridden to, instead of detecting the user’s language (overriding is not recommended).branding="yes"
: Display your company’s logo during the booking process.bookable_only="yes"
: Only show availabilities which can booked online. This is very useful when reselling another company’s activities.
Available options: [fareharbor] only
lightframe="no"
: Use this if you want to disable the Lightframe booking overlay. It is set to “yes” by default.
Available options: [lightframe] only
The Lightframe has a set of special options that allow you to choose which view it should open to. To learn more, please reference the Lightframe API documentation. Setting the view is optional, and if omitted will default to the item grid.
view="items"
: To open to the grid of all items or all-availability calendar, set view to “items” or “all-availability”.view_item="100"
: To open to the calendar for a specific item, set view_item to the ID of that item.view_availability="123456"
: To open to the calendar directly to booking a specific availability, setview_item
to the availability’s item ID andview_availability
to its ID.
Custom attributes may also be set on the anchor that is generated:
class="your-class"
,id="your-id"
, andstyle="color:blue;"
: Put custom classes, an ID, or custom inline styles on the anchor generated by the shortcode.
Available options: [partners] only
include="shortnames"
: Which partner companies to include in the embed. This is required.
Setting defaults for shortcode options
If you’d like, you can set default options for all of the above shortcodes on the FareHarbor plugin settings page.
To set default options:
- Navigate to your WordPress Dashboard
- From the sidebar, choose Settings, then FareHarbor
- In the Shortcode Defaults section, enter default values for any of the available options
When a default value is entered, that option will be applied to every FareHarbor shortcode on your website, unless otherwise defined.
Note: The options written inline when including a shortcode on a page will always take precedence over the default values. This allows the default values to be overridden if needed.
Examples
Below are some examples of how various shortcodes will be read by the plugin when the default shortname is set to companyone:
Written shortcode: | Shortcode with default value: |
---|---|
[lightframe]Book Now[/lightframe] |
[lightframe shortname="*companyone*"]Book Now[/lightframe] |
[fareharbor items="123,456"] |
[fareharbor shortname="*companyone*" items="123,456"] |
[fareharbor shortname="*companytwo*" items="123,456"] |
[fareharbor shortname="*companytwo*" items="123,456"] |
In the last instance, companytwo overrides the default shortname, meaning the plugin will produce an availability calendar for companytwo instead of the default companyone.