WordPress
The Leo Cal plugin — upload it, paste your key, add the Elementor widget or a shortcode.
The plugin stores your browser key, loads the embed script, and puts Leo Cal on your
pages in one of four ways — from the Elementor widget, a shortcode, or a setting.
No booking data, customer details or payments pass through WordPress — everything
happens in the Leo Cal frame, served from cal.turfleo.com.
| Variant | What the visitor sees |
|---|---|
| Booking card | The card on the page: sport, court, date, the free times and the price. Choosing a time opens a pop-up for the details and payment. |
| Button → centred pop-up | A button opening the booking panel as a box in the middle of the page. |
| Button → sheet from the top | A button dropping the full-width booking panel from the top of the window on a desktop. |
| Floating button | A button pinned to a bottom corner of the screen, opening the pop-up. |
Phones get the booking panel full screen whichever button opens it.
It needs WordPress 5.8 or newer and PHP 7.4 or newer.
Install
Download the plugin
From the embed screen in your dashboard (Settings → Integrations → Your own website or
app), or directly from https://cal.turfleo.com/downloads/leo-cal-wordpress.zip.
Upload and activate
In WordPress: Plugins → Add New → Upload Plugin, choose the zip, Install Now, then Activate.
Paste your key
Settings → Leo Cal, and paste the browser key (gxp_…) from your dashboard. The
site's address must be listed against that key in the dashboard, with its scheme —
https://yourvenue.com, and https://www.yourvenue.com if it answers on both.
Add it to a page
With Elementor, add the Leo Cal booking widget (below). Without it, add one of the shortcodes to any page or post.
Use the browser key, not the secret one
The plugin refuses a key that starts with gx_ — that is a secret key, and pasting it
here would publish it in every page's HTML. If you did paste one somewhere, rotate it
from the dashboard. A browser key (gxp_…) is the right one.
Elementor
Search the widget panel for Leo Cal booking (it has its own Leo Cal category) and drop it on the page. Its settings, all picked from lists — no attributes to type:
| Setting | What it does |
|---|---|
| Show as | Which of the four variants: booking card, button → centred pop-up, button → sheet from the top, or floating button. |
| Branch, Sport, Court | Where the booking opens, chosen from your venue's own lists. Sport lists only the sports the chosen branch has courts for, and Court only that branch's courts for the chosen sport, or all of them with All. Left on the first option, the customer chooses (and the branch is the one nearest them). |
| Button text, Button look | For the three buttons. Looks: Solid (your brand colour), Outline, Dark, Text link, or your theme's button. |
| Alignment | For the two in-page buttons. |
| Card width | For the card: pixels or a percentage of the column. |
| Corner | For the floating button: bottom left or bottom right. |
The Style tab fine-tunes a button: font, colours (normal and hover), corner radius and padding. Elementor's preview shows the real card, live, while you edit.
The lists come from your key — if they are empty, check the key in Settings → Leo Cal. They are refreshed every ten minutes, or at once when you save the settings.
Shortcodes
[leo_cal] — a button
[leo_cal]
[leo_cal label="Book football" sport="football"]
[leo_cal type="sheet" style="dark"]
[leo_cal type="floating" position="left" label="Book now"]
[leo_cal label="Book at Gandipet" branch="gandipet" class="my-button"]| Attribute | What it does | Default |
|---|---|---|
type | popup (centred pop-up), sheet (from the top), floating (bottom corner), or card | popup |
style | solid (your brand colour), outline, dark, link, or theme (your theme's button) | solid |
label | The button text | "Book a court", or what you set in Settings → Leo Cal |
sport | Opens on this sport | The sport set in Settings, or none |
branch | Opens on this branch | The branch set in Settings, or the one nearest the customer |
court | Opens on this court | none |
align | left, center or right, for the in-page buttons | none |
position | right or left, for type="floating" | right |
key | Use a different browser key for this button | The key set in Settings |
class | Extra CSS class(es) on the button | none |
[leo_cal_card] — the booking card on the page
[leo_cal_card]
[leo_cal_card sport="football" width="100%"]
[leo_cal_card branch="gandipet" width="420px"]| Attribute | What it does | Default |
|---|---|---|
width | Any CSS length: 380px, 100%, 30rem, 50vw… | 380px |
sport, branch, court, key, class | As above | as above |
The same as [leo_cal type="card"].
The card never grows wider than its column. Use width="100%" to fill it. To place it
over a cover image, give it a class and position it with your theme's CSS — the same
recipes as in Embedding.
Any other button
You do not need a shortcode to open the pop-up. Add the attribute data-leo-cal to any
element — a menu item, an image link, a block's "Additional HTML" — and clicking it opens
the booking window. Once your key is set, the plugin loads the script on every page, so
nothing else is needed.
| Attribute | What it does |
|---|---|
data-sport | Opens on this sport: its name, such as tennis or table-tennis |
data-branch | Opens on this branch, by name |
data-court | Opens on this court, by name |
data-popup="sheet" | The sheet from the top instead of the centred pop-up |
On an Elementor button
To use one of Elementor's own buttons (or an add-on's), open the button's Advanced tab →
Attributes (an Elementor Pro feature) and put one attribute per line, with a |
between the name and the value:
data-leo-cal
data-sport|tennisWritten as HTML on one line instead, such as data-leo-cal sport="tennis", Elementor keeps
only the first attribute: the button still opens the booking window, but on the first sport
rather than tennis.
Settings → Leo Cal
| Setting | What it is |
|---|---|
| Browser key | Your gxp_… key. Safe to publish. |
| Button text | The label on [leo_cal] buttons. |
| Preselect sport | Optional. The sport's name, such as football or table-tennis. |
| Preselect branch | Optional, for venues with more than one location. |
| Site header | Optional: your theme's header as a CSS selector (.elementor-location-header, #masthead). The sheet slides in under it and leaves it showing. |
| Floating button | A floating booking button on every page, with its text, look and corner. For one page only, use the Elementor widget's floating button instead. |
| Widget address, API address | Leave as they are, unless Turfleo support asks you to change them. |
A visitor who is not signed in never sees an error from a missing key: the shortcodes render nothing until a key is set, and an editor sees a short note telling them to add one.
Caching and page builders
The script has a fixed, versioned file name, so your cache plugin can keep it. With Elementor, use the widget. With another page builder that does not run shortcodes, add the HTML from Embedding in its custom-HTML block instead — it works the same.