Shortcodes

Glossary by Codeat includes some shortcodes that allow you to use your glossary independently of the automatic engine for the plugin. Thanks to the shortcodes, you can also ignore certain terms within a specific content, display an alphabetical index, and list categories or terms within posts and pages.

List of Categories

Shortcode: [glossary-cats]

This shortcode generates a list of your glossary’s categories, as in to the example below:

Shortcode output example: list of categories
Shortcode output example: list of categories

Optional shortcode parameters

order : asc or desc

This shortcode regulates the order, ascending or descending, in which categories are listed. For example, to show a list in ascending order, your shortcode should be: [glossary-cats order="asc"]

num

With this shortcode, you can adjust the number of categories to show. For example, if you wish to show only 5 categories, your shortcode should be: [glossary-cats num="5"]

Tip

You can combine the optional parameters in the way you think is most useful for you.
For example: [glossary-cats order="asc" num="5"]

List of Terms

Shortcode: [glossary-terms]

If you are using a shortcode from Glossary v1.x., keep in mind that some parameters changed, so you should check the legacy paragraph below.

This shortcode will generate a list of your glossary’s terms, similar to the example below.

Optional shortcode parameters

order : asc or desc

This shortcode regulates the order, ascending or descending, in which terms are listed. For example, to show a list in ascending order, your shortcode should be: [glossary-terms order="asc"]

num

With this shortcode, you can adjust the number of terms to show. For example, if you wish to show only 20 terms, your shortcode should be: [glossary-terms num="20"]

tax

This shortcode allows you to filter your list through an established classification (taxonomy).
Let’s say you wish to classify your key terms as ”fruits” or “vegetables”. You can create your Terms categories (fruits; vegetables) and then group your key terms as either one or the other.
So you can populate your vegetables list thanks to this shortcode: [glossary-terms tax="vegetables"]

Repeat the same procedure for the terms of the ”fruits” category.

Attention

This shortcode parameter requires the category slug or the ID. You can check the slug in the Terms Categories page under Glossary > Terms Categories

Tip

You can combine the optional parameters in the way you think is most useful for you.
For example: [glossary-terms num="25" order="desc" tax="rock-music"]

Legacy

Remapped parameters:

  • tax: taxonomy

Glossary Index (Premium)

Shortcode: [glossary-list]

If you are using a shortcode from Glossary v1.x., keep in mind that some parameters changed, so you should check the legacy paragraph below.

This Premium shortcode generates an alphabetical index for all your Glossary terms. See the example below:

Shortcode output example: Glossary Index
Shortcode output example: Glossary Index

Attention

The output of this shortcode is cached daily in a transient, so you might not see the new terms right away. To view the changes before the cache expires you can clear the transient from the appropriate button.

Optional shortcode parameters

letter-anchor : true (default) or false

This parameter regulates how the letter is linked to its anchorage: within the same list or to its archive page.

If you do not set this parameter or set it to true, the letter will be linked to the same page's relative anchor.

[glossary-list anchor="true"]

If you set it to false, the letter will be linked to a dedicated archive page that groups all the terms beginning with that letter:

[glossary-list anchor="false"]


term-anchor : true or false (default)

If this parameter is set to true, then the terms in the list will not have any links:

[glossary-list noanchorterms="true"]


custom-url : true or false (default)

If this parameter is true it will print the Internal/External URL set in the term.

Attention

The Internal/External URL of the term cannot be empty, and the nonanchorterms parameter must be set to false (default).

[glossary-list customurl="true"]


empty-letters : true (default) or false

This parameter adjusts the visibility of letters that are not linked to any term. If set to true (default), the index will show all letters, including those containing no terms. If set to false, the table of contents will only show letters that match the terms of the glossary.

[glossary-list empty="false"]


taxonomy

This parameter allows you to filter your list through an established classification (taxonomy).
Let’s say you wish to classify your key terms as “fruits” or “vegetables”. You can create your Terms categories (fruits; vegetables) and then group your key terms as either one or the other.

So your vegetables list will be populated thanks to this shortcode: [glossary-list taxonomy="vegetables"]

Attention

This shortcode parameter requires the category slug or ID. You can check the slug in the Terms Categories page under Glossary > Terms Categories

Tip

If you need to enter more than one category, separate them with a comma.
For example: [glossary-list taxonomy="rock,pop,blues,country"]


theme : default (default) or grid

This parameter adjusts the layout of the term list. If set as default, the terms will be grouped by letter and listed as a list.
If it’s set to grid, the terms will be placed side by side in columns.

[glossary-list theme="grid"]


search : disabled (default), scroll, scroll-bottom or no-scroll

With this parameter, you can show a search bar that points to the term in the list. If set to no-scroll the search bar will not scroll along with the page and will remain anchored at the top, above the letter bar.
Using the scroll-bottom parameter the search field will be fixed at the bottom of the screen.

[glossary-list search="scroll"]


excerpt : true or false (default)

By setting this parameter to true, you can show the excerpt alongside the term.

[glossary-list excerpt="true"]


content : true or false (default)

By setting this parameter to true, you can show the content alongside the term.

[glossary-list content="true"]


show-letter

This parameter allows you to choose which letters and their terms to show.

[glossary-list show-letter="A,C,D,Z"]

Attention

If you need to enter more than one letter, separate them with a comma.


Tip

You can combine the optional parameters in the way you think is most useful for you.
For example: [glossary-letters excerpt="true" search="no-fixed" letters="D,N,S,T,X" theme="grid"]

Legacy

Remapped parameters:

  • anchor: letter-anchor
  • customurl: custom-url
  • empty: empty-letters
  • letters: show-letter
  • noanchorterms: term-anchor - (parameter is inverted)
  • search: values are changed, false/disabled or true/scroll or no-fixed/no-scroll

Parse content (Premium)

Shortcode: [glossary]the text you want to parse from Glossary[/glossary]

This is a Premium shortcode that parses specific content from Glossary and executes the plugin.

It’s useful if you’re using Visual Composer, Page Builder (but also Gutenberg). Generally speaking, page builders are not easy to support because they tend to behave in a non-standard way. Sometimes, this may cause Glossary not to execute automatically or to parse incorrect content: in these scenarios, the shortcode fixes the issue.

Tip

The shortcode ignores the plugin settings on the post type, so you can also run it on other post types.

Ignore terms (Premium)

Shortcode: [glossary-ignore]the text you want to parse from Glossary[/glossary-ignore]

This is a Premium shortcode that ignores specific content from Glossary and executes the plugin.

It’s useful if you’re using Visual Composer, Page Builder (but also Gutenberg). Generally speaking, page builders are not easy to support because they tend to behave in a non-standard way. Sometimes, this may cause Glossary not to execute automatically or to parse incorrect content: in these scenarios, the shortcode fixes the issue.

Tip

The shortcode ignores the plugin settings on the post type, so you can also run it on other post types.