Category related shortcodes
These shortcodes show your Arlo categories: a linked category tree, a breadcrumb trail, and the name, header text and footer text of the category being viewed.
They work with the selected category. This is the category in the page address (for example /events/cat-12-leadership/), or else the first category in the category attribute of the page shortcode, for example [arlo_event_template_list category="12"] (see global shortcodes),
or else the category chosen by a category filter for the page on the Pages tab.
When none of these gives a category, the top-level category is used.
The HTML shown for each shortcode is what the plugin outputs, with line breaks and indentation added for readability. Names, IDs and URLs are examples. A category slug starts with its Arlo ID, such as 12-leadership.
Contents
- [arlo_categories] – linked category tree
- [arlo_category_breadcrumb] – breadcrumb trail to the selected category
- [arlo_category_title] – name of the selected category
- [arlo_category_header] – header text of the selected category
- [arlo_category_footer] – footer text of the selected category
Quick start
A minimal Catalogue template section, shown here for a page whose page shortcode has category="12" (Leadership):
[arlo_category_title wrap="<h2>%s</h2>"]
[arlo_category_header]
[arlo_category_breadcrumb item="<span data-slug='{slug}'>{label}</span>" divider=" / "]
[arlo_categories depth="2" counts=" (%d)"]
[arlo_category_footer]
Rendered as HTML:
<h2>Leadership</h2> <p>Develop your leadership skills.</p> <span data-slug="1-training">Training</span> / <span data-slug="12-leadership">Leadership</span> <ul class="arlo-category-list"> <li><a href="https://example.com/events/cat-13-coaching">Coaching (4)</a></li> <li><a href="https://example.com/events/cat-14-mentoring">Mentoring (3)</a></li> </ul> <p>Contact us to arrange a private course.</p>
[arlo_categories]
Outputs a nested list of links to the categories below the starting category.
Use in: the Catalogue, Schedule, Upcoming events and Online activities templates, and the Categories widget.
Structure
[arlo_categories parent="0" depth="2" counts=" (%d)" title="<h3>Browse %s</h3>"]
Output (example)
Rendered as HTML:
<h3>Browse Training</h3>
<ul class="arlo-category-list">
<li><a href="https://example.com/events/cat-12-leadership">Leadership (12)</a>
<ul class="arlo-category-list">
<li><a href="https://example.com/events/cat-13-coaching">Coaching (4)</a></li>
</ul>
</li>
</ul>
Usage
- The list shows the categories below the starting category. The starting category's own name is what
%sintitleshows. - Each link opens the same kind of page as the one you are on (the Catalogue from the Catalogue, the Schedule from the Schedule) for that category, in the active region.
- Categories hidden by the page's category filter are left out.
Attributes
| Attribute | Type / values | Default | Description |
|---|---|---|---|
| depth | Integer | 1 | Number of category levels to list. 1 lists only the first level. |
| title | Text; HTML as allowed in a WordPress post | None | Shown once, before the list. %s is replaced with the name of the starting category. |
| counts | Text containing %s or %d |
None | Appended after each category name, with the placeholder replaced by the number of event templates in that category and its subcategories. Include your own leading space or bracket. |
| parent | Integer (Arlo category ID) | The selected category, otherwise the top level | Lists the categories below this one. parent="0" always starts at the top level. |
| widget | Option: true |
Not set | Set by the Categories widget so that links always open the Catalogue page. Not normally used in templates. |
Also accepts the universal attributes. See attribute values and placeholders for how %s and %d work.
Examples
With no attributes, the list shows only the first level, with no title and no counts. Shown for a page whose page shortcode has category="12" (Leadership):
[arlo_categories]
<ul class="arlo-category-list"> <li><a href="https://example.com/events/cat-13-coaching">Coaching</a></li> <li><a href="https://example.com/events/cat-14-mentoring">Mentoring</a></li> </ul>
[arlo_category_breadcrumb]
Outputs the path from the top-level category down to the selected category.
Use in: the Catalogue, Schedule, Upcoming events and Online activities templates.
Structure
[arlo_category_breadcrumb
item="<span role='button' tabindex='0' data-slug='{slug}'>{label}</span>"
divider='<div aria-hidden="true" class="arlo-triangle"></div>']
Output (example)
Rendered as HTML, for the category Coaching inside Leadership inside Training:
<span role="button" tabindex="0" data-slug="1-training">Training</span> <div aria-hidden="true" class="arlo-triangle"></div> <span role="button" tabindex="0" data-slug="12-leadership">Leadership</span> <div aria-hidden="true" class="arlo-triangle"></div> <span role="button" tabindex="0" data-slug="13-coaching">Coaching</span>
Usage
Always set the item attribute
Without item, each step is the literal text %s, which renders incorrectly.
{slug}and{label}are the only placeholders. They are not%splaceholders.- The markup is filtered like WordPress post content, so a value placed in
href,srcorstylecannot run script. Put the placeholders in element text or adata-attribute, or after a fixed prefix such ashref="/events/cat-{slug}".
Attributes
| Attribute | Type / values | Default | Description |
|---|---|---|---|
| item | Text; HTML as allowed in a WordPress post | %s |
The markup for each step. {slug} is replaced with the category slug and {label} with the category name. |
| divider | Text; HTML as allowed in a WordPress post | Empty | Output between steps. |
Also accepts the universal attributes.
Examples
A plain text trail, with the name only and a text divider:
[arlo_category_breadcrumb item="{label}" divider=" / "]
Training / Leadership / Coaching
[arlo_category_title]
Outputs the name of the selected category as plain text.
Use in: the Catalogue, Schedule, Upcoming events and Online activities templates.
Structure
[arlo_category_title wrap="<h1>%s</h1>"]
Output (example)
Rendered as HTML, for the category Leadership:
<h1>Leadership</h1>
Attributes
None. Accepts the universal attributes; wrap is used in the example above.
Examples
Plain, without wrap:
[arlo_category_title]
Leadership
[arlo_category_header]
Outputs the header text of the selected category, as entered for the category in Arlo.
Use in: the Catalogue, Schedule, Upcoming events and Online activities templates.
Structure
[arlo_category_header wrap="<div class='category-intro'>%s</div>"]
Output (example)
Rendered as HTML, for header text <p>Develop your leadership skills.</p>:
<div class="category-intro"><p>Develop your leadership skills.</p></div>
Usage
- Header text is often empty. Use
wraprather than your own tags around the shortcode: when there is no header text, nothing is output, including the wrapper.
Attributes
None. Accepts the universal attributes; wrap is used in the example above.
Examples
Plain, without wrap, the stored text is output as it is:
[arlo_category_header]
<p>Develop your leadership skills.</p>
[arlo_category_footer]
Outputs the footer text of the selected category, as entered for the category in Arlo.
Use in: the Catalogue, Schedule, Upcoming events and Online activities templates.
Structure
[arlo_category_footer wrap="<div class='category-outro'>%s</div>"]
Output (example)
Rendered as HTML, for footer text <p>Contact us to arrange a private course.</p>:
<div class="category-outro"><p>Contact us to arrange a private course.</p></div>
Usage
- Footer text is often empty. Use
wraprather than your own tags around the shortcode: when there is no footer text, nothing is output, including the wrapper.
Attributes
None. Accepts the universal attributes; wrap is used in the example above.
Examples
Plain, without wrap, the stored text is output as it is:
[arlo_category_footer]
<p>Contact us to arrange a private course.</p>