Displaying on Posts & Pages
Displaying Chatbots on Posts & Pages
Integrating your Supervised AI chatbots into your content is handled via a simple WordPress shortcode. This allows you to place specific bots on specific pages or posts to provide targeted assistance to your visitors.
The Shortcode Syntax
The primary way to display a chatbot is by using the [supervised_ai_bot] shortcode. This shortcode requires an id attribute to identify which chatbot to load.
[supervised_ai_bot id="X"]
Understanding the ID Attribute
The id refers to the sequence of the chatbot URLs you entered in the Supervised AI Bots settings page:
- id="1": Displays the chatbot corresponding to the first URL (line 1).
- id="2": Displays the chatbot corresponding to the second URL (line 2).
- id="n": Displays the chatbot corresponding to the n-th URL line.
How to Embed
You can add the shortcode anywhere within the WordPress editor:
Using the Block Editor (Gutenberg)
- Open the post or page where you want the chatbot to appear.
- Click the + icon to add a new block.
- Search for the Shortcode block.
- Paste your shortcode, for example:
[supervised_ai_bot id="1"]. - Update or Publish the page.
Using the Classic Editor
- Open your post or page.
- Paste the shortcode
[supervised_ai_bot id="1"]directly into the text editor where you want the trigger logic to reside. - Save your changes.
User Interface & Behavior
Once the shortcode is added to a page:
- Floating Launcher: A blue circular chat icon will appear at the bottom-right corner of the visitor's screen.
- Popup Interface: Clicking the icon opens a specialized popup window (800px max-width) containing the Supervised AI chatbot interface.
- Responsive Design: The chat window is styled to remain fixed in the bottom-right corner, ensuring it stays accessible as users scroll through your content.
Best Practices
- Contextual Relevance: Use different IDs on different pages. For example, place a "Support Bot" (ID 1) on your documentation pages and a "Sales Bot" (ID 2) on your pricing page.
- One Bot Per Page: To avoid interface conflicts, it is recommended to use only one
[supervised_ai_bot]shortcode per page. - Check Settings: If a chatbot fails to appear, ensure the URL in the settings page is correct and that the
idin your shortcode matches the correct line number.