Displaying Bots in Content
Displaying Bots in Content
The Supervised AI Bots plugin uses a flexible shortcode system, allowing you to embed your configured chatbots anywhere on your site—including posts, pages, and widget areas.
The Shortcode Syntax
To display a bot, use the following shortcode structure:
[supervised_ai_bot id="YOUR_BOT_ID"]
Determining the Bot ID
The id attribute corresponds to the row number of the URL you entered in the plugin settings page.
- Navigate to Supervised AI Bots in your WordPress admin dashboard.
- Locate the list of URLs in the configuration textarea.
- Count the lines to find your ID:
- The URL on Line 1 has
id="1". - The URL on Line 2 has
id="2", and so on.
- The URL on Line 1 has
Placement Options
You can insert the shortcode into several areas of your WordPress site:
1. Pages and Posts
Insert the shortcode directly into the Block Editor (Gutenberg) using a Shortcode Block, or paste it into the Classic Editor.
<!-- Example: Embedding the first bot in a blog post -->
Check out our AI assistant below:
[supervised_ai_bot id="1"]
2. Sidebar and Footer Widgets
You can add a bot to your site's sidebar or footer by adding a Shortcode Widget or a Text Block in the Appearance > Widgets section.
3. Theme Template Files
If you are a developer and wish to hardcode a bot into a specific theme template, use the do_shortcode() PHP function:
<?php echo do_shortcode('[supervised_ai_bot id="1"]'); ?>
User Experience
When the shortcode is processed on the front end:
- A floating action button (launcher) will appear in the bottom-right corner of the screen.
- Clicking the button will toggle the chat interface, which displays the Supervised AI chatbot in a mobile-responsive popup container.
Examples
| Goal | Shortcode |
| :--- | :--- |
| Display your primary bot | [supervised_ai_bot id="1"] |
| Display a secondary bot | [supervised_ai_bot id="2"] |
| Display a specialized bot (e.g., from row 5) | [supervised_ai_bot id="5"] |