Knowledge Base includes multiple shortcodes for embedding the knowledge base, search form, breadcrumbs, alerts, and related articles anywhere in your content.
[knowledgebase]
You can display the knowledge base anywhere in your blog using the [knowledgebase] shortcode. The shortcode takes one optional attribute category, e.g.:
category: Category ID for which you want to display the knowledge base. You can find the ID in the Sections listing under the Knowledge Base menu in the WordPress Admin
[kbsearch]
Display the search form using the [kbsearch] shortcode.
[kbbreadcrumb]
You can display the knowledge base anywhere in your blog using the [kbbreadcrumb] shortcode. The shortcode takes one optional attribute separator, e.g.:
separator: The separator is used between each “crumb” of the entire breadcrumb
[kbtoc]
Render a table of contents for the current article. The TOC is built from the article’s headings and respects the same depth and minimum-heading settings as the auto-generated TOC.
Optional attributes override the global settings for that placement:
| Attribute | Alias | Default | Description |
|---|---|---|---|
heading_depth | headingdepth | Setting value | Maximum heading level to include (2–6). |
min_headings | minheadings | Setting value | Minimum headings required before the TOC is shown. |
title | — | Setting value | Label above the TOC list. Pass an empty string to hide it. |
Example:
See Table of Contents for the full feature guide.
[kb_related_articles]
Display a list of related articles below any content. Uses the same relevance engine as the automatic related articles feature.
Optional attributes:
| Attribute | Default | Description |
|---|---|---|
numberposts | 5 | Number of related articles to show. |
show_thumb | true | Show article thumbnails. |
show_date | true | Show article publish dates. |
title | <h3>Related Articles</h3> | Section heading; accepts HTML. |
thumb_size | thumbnail | Registered image size for thumbnails. |
See Knowledge Base Related Articles for developer hooks and advanced usage.
[kbalert]]
You can use this shortcode to display a different set of alerts within your Knowledge Base articles or even the rest of your WordPress site. This is similar to what you’d see in Bootstrap or other plugins.
The shortcode takes three optional attributes, e.g.:
- type: alert type as per the screenshot above. Default is ‘primary’
- class: additional classes to include in the wrapping div as a space- or comma-separated list. Default is ‘alert’
- text: any additional text you want to include before the wrapped content. In the above example, the wrapped content is “A secondary alert”
