WordPress Glossary Plugin (CMTG) - Localization - Displaying Tooltip Outside the Main Content


Parsing Tooltip Content Everywhere

Back to User Guide

The WordPress Glossary plugin settings illustrated in the image below can be found in Admin Dashboard → CM Tooltip Glossary → Settings → General Settings tab.

Term highlighting settings - WordPress Knowledge Base Plugin
Term highlighting settings
  • Highlight terms on given post types - Select the custom post types where you'd like the Glossary Terms to be highlighted.
  • Only show terms on single posts/pages (not Homepage, authors etc.)? - Select this option if you wish to only highlight glossary terms when viewing a single page/post. This can be used so terms aren't highlighted on your homepage, or author pages and other taxonomy related pages.
  • Only highlight white-listed and non-blacklisted terms? - Select this option if you wish to only highlight glossary terms on posts/pages, which have: white-listed terms/categories or black-listed terms/categories. This means adding the terms to the glossary won't be enough to highlight. Note: this option available in Pro+ and Ecommerce versions only.
  • Highlight terms in bbPress replies? - Select this option if you wish to highlight Glossary Terms in ALL of the "bbPress" replies.
  • Highlight terms on BuddyPress pages? - Select this option if you wish to highlight Glossary Terms in ALL of the "bbPress" replies.
  • Highlight terms in BuddyBoss activity content? - Select this option if you wish to highlight Glossary Terms in the BuddyBoss activity content. Note: this option was introduced in version 4.0.0.
  • Highlight first term occurrence only - Select this option if you want to only highlight the first occurrence of each term on a page/post.
  • Highlight first term occurrence - exception tag - Use this option if you would like to have an exception tag for the Highlight first term occurrence only or Highlight every nth occurrence only options. The value should be a single HTML tag name eg. "strong". If you want to add a few exception tags, you should separate them by comma, eg "strong,em". Every occurrence of terms directly wrapped with the selected tag will be highlighted. Note: this option was introduced in version 4.1.3.
  • Highlight first term occurrence - exception class - Use this option if you would like to have an exception class for the Highlight first term occurrence only or Highlight every nth occurrence only options. The value should be a single HTML class name eg. "schema-faq-answer". If you want to add a few exception tags, you should separate them by comma, eg "schema-faq-answer,display-tooltip". Every occurrence of terms directly wrapped with the tag that has this class will be highlighted. Note: this option was introduced in version 4.1.3.

    Examples of using exception tags and classes

    Here are the tags and classes which we added in plugin settings:

    Exception tags and classes - Knowledge Base WordPress Plugin
    Exception tags and classes

    And here is how it works - when the option Highlight first term occurrence only is enabled, only the first term occurrence is highlighted and those occurrences that are wrapped by tags and classes which we added to exceptions.

    Example of using exception tags and classes - Glossary Plugin WordPress
    Example of using exception tags and classes
  • Highlight every nth occurrence only - Select this option if you want to only highlight every N-th occurrence of a term (or it's synonyms/variations) on a page/post. Setting it to 3 means that only every third occurrence will be highlighted. Set to 1 to highlight all occurrences. Important: This option doesn't work if the option Highlight first term occurrence only? is enabled. Note: this option was introduced in version 4.0.8 only in Ecommerce edition. Learn more about this feature in this guide: WordPress Glossary Plugin (CMTG) - Term - Highlight Every N-th Occurrence Only
  • Highlight each variations/synonyms of the term - Select this option if you want to only highlight the first occurrence of each of the terms form/variant/synonym. eg. if the term is "HTML" and it appears in the content as both "HTML" and "html", both will be highlighted.
  • Highlight only space separated terms - Select this option if you want to only search for the terms separated from other words (usually by space).
  • Highlight the terms in comments - Select this option if you want to highlight the glossary terms in the comments. Note: this option is available only in Pro+ and Ecommerce editions of the plugin.
  • Highlight the terms in Text Widget - Select this option if you want to highlight the glossary terms in the Text Widget built in WordPress.
  • Highlight the terms in WPBakery - Select this option if you want to highlight the glossary terms in the WPBakery shortcodes.
  • Highlight the terms in Ninja Tables - Select this option if you want to highlight the glossary terms in the Ninja Tables. Note: this feature was introduced in version 3.9.14.
  • Highlight the terms on category/tag pages - Select this option if you want to highlight the glossary terms on category/tag pages.
  • Exclude HTML tags from parsing - Select which tags you don't need to parse. Uncheck all if you need to parse all tags.
  • Excluded HTML Classes - You can put here the comma separated list of IDs of the HTML classes you would like to exclude from being parsed. Note: this option is available only in Pro+ and Ecommerce editions of the plugin.
  • Excluded HTML tags - You can put here the comma separated list of tags you would like to exclude from being parsed. Note: this option is available only in Pro+ and Ecommerce editions of the plugin.
  • Exclude hyphenated words - Select this option if you wish to exclude hyphenated words, like camera-ready, up-to-date and well-known.
  • Exclude words in double quotes - Select this option if you wish to exclude words in double quotes.
  • Highlight terms on it's own page - Select this option if you wish to highlight term on it's own page.

However, some of the more advanced WordPress themes are using more sophisticated methods of setting up the content of posts and pages then “the_content” function, (such as PageBuilder, VisualComposer etc), which means that the terms are not parsed nor highlighted.

There are at least two ways to highlight terms anywhere on your website, regardless of what WordPress theme you’re using:

1) By wrapping content with a shortcode:

[cm_tooltip_parse] some content with terms [/cm_tooltip_parse]

This method should be good enough for users who have some experience with WordPress. When a part of the page is wrapped with this shortcode, the parsing mechanism will search for glossary terms exactly as if it was outputted by the “the_content” function, which should override the limitations of certain WordPress themes.

2) By wrapping the apply_filters:

apply_filters('cm_tooltip_parse', $content, true)

$content  Is the variable we want to parse in search for glossary terms in order to highlight them]

This method is mainly for experienced WordPress users, such as plugin authors and WordPress theme developers. Instead of wrapping content with the shortcode, one can apply the filters hooked into the “cm_tooltip_parse”, which is an internal hook introduced by the WordPress Glossary Plugin, and then echo the result. Again, the parsing mechanism will highlight the terms from the glossary.

Note on Compatibility

If you use a page builder and the shortcode is not working, a possible fix is to wrap the first and last instances of the shortcode with an HTML object. 

Example

<div>[cm_tooltip_parse]</div> Content 1 [/cm_tooltip_parse]

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam et.

[cm_tooltip_parse] Content 2 [/cm_tooltip_parse]

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam et.

[cm_tooltip_parse] Content 3 <div>[/cm_tooltip_parse]</div>

This fix has been reported to work on the Nicepage page builder.


More information about the WordPress Glossary Plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.