Using Shortcodes

When Indexy is installed on your WordPress website, it adds several shortcodes that you can use within your posts to automatically insert content. The following shortcodes are supported by Indexy:

  • [indexy_excerpt]
  • [indexy_highlight]
  • [indexy_ignore]
  • [indexy_index]

indexy_excerpt

This shortcode lets you insert an excerpt of a glossary article in any other post. The shortcode is automatically replaced with either an automatically generated excerpt, or a manually crafted one, if you have created one on the term’s page. If you ever update the term, excerpts included in another page using this method will automatically update as well.

You’ll need to specify the term from which to include an excerpt, like so:

[indexy_excerpt term="Shakespeare"]

WordPress will then automatically replace this with an excerpt of the glossary page titled “Shakespeare”. Currently, you have to specify an actual article; not a synonym.

Note: if the specified term does not exist in your glossary, nothing will be shown.

Controlling the excerpt length

By default, if you didn’t write an excerpt by hand when creating the glossary page, Indexy will automatically generate an excerpt by taking the first 55 words from the article. If you’d prefer a different length, you can do so by specifying the optional length parameter:

[indexy_excerpt term="Shakespeare" length="25"]

Now, the excerpt will be 25 words long instead of the default 55.

indexy_highlight

Normally, Indexy automatically highlights terms in your posts for you. However, if you’d like to manually highlight a word (or sentence, or paragraph), you can use the indexy_highlight shortcode. If you write:

[indexy_highlight term="Shakespeare"]William[/indexy_highlight] was born in April 1564.

the word ‘William’ will be highlighted, and clicking it will bring the user to the article about Shakespeare.

Similar to indexy_excerpt, you cannot use a synonym for the term. If the term does not exist in your glossary, the text won’t be highlighted, but it will still appear in your post as normal.

indexy_ignore

The indexy_ignore shortcode can be used to prevent Indexy from highlighting terms within a section of a post or page. Any section enclosed in the [indexy_ignore] ... [/indexy_ignore] tags will not be highlighted.

If you omit the closing [/indexy_ignore] tag, all text beyond that point will not be highlighted.

indexy_index

indexy_index is a shortcode that inserts a complete index of all terms in your glossary, sorted by starting letter.

Indexy Screenshot 1

As default, the generated index shows terms as well as their synonyms in the list. If you prefer, you can instead hide synonyms by specifying the optional ignore_synonyms parameter:

[indexy_index ignore_synonyms="true"]

You can customize the appearance of the generated index using CSS. To learn how to do so, please refer to the Customizing Indexy page.

A Soul Waking