WordPress
A complete guide to integrate the InBe widget within your WordPress website.
This guide will help you add the InBe widget to your WordPress website using custom code.
Method 1: Using a Custom HTML Block (Recommended)
Add the widget container and scripts
- In your WordPress editor, add a Custom HTML block to your page or post
- Add both the container and scripts in the HTML block:
- Update or publish your page
Method 2: Using theme files
Add the widget container
- In your WordPress admin, go to Appearance → Theme Editor
- Select the template file where you want to add the widget (e.g.,
index.php
,page.php
) - Add the container element where you want the widget to appear:
Add the widget scripts
- In your theme editor, open
functions.php
- Add this code to enqueue the scripts:
- Click Update File
Method 3: Using a Plugin
If you prefer using a plugin:
- Install a plugin like
Insert Headers and Footers
orCode Snippets
- Add the first script to the Header section
- Add the initialization script (2nd script tag) to the Footer section
- Add the container element to your page content with id
inbe-widget
. If you have changed the id, use the id you have chosen.
Important Notes
Make sure to replace YOUR_PUBLIC_API_KEY
with your actual API key. The
widget will appear where you placed the container element. Method 1 (Custom
HTML Block) is the easiest for most users.
Troubleshooting
If the widget doesn't appear: 1. Ensure the container element exists on the page, 2. Check that your API key is correct, 3. Try clearing your browser cache, 4. Make sure both script tags are properly added, 5. If using a caching plugin, clear the cache