Created
December 1, 2025 22:26
-
-
Save viggy28/a4ef92db88b2a83c2b95d2b6aeaedea4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Option 1: Add to your page/post content (HTML block) --> | |
| <div id="myclone-inline-chat" style="width: 100%; height: 600px;"></div> | |
| <script src="https://app.myclone.is/embed/myclone-embed.js"></script> | |
| <script> | |
| window.MyClone({ | |
| mode: "inline", | |
| container: "#myclone-inline-chat", | |
| height: "600px", | |
| expertUsername: "replaceme", | |
| widgetToken: "YOUR_WIDGET_TOKEN", | |
| primaryColor: "#6366f1", | |
| enableVoice: true, | |
| }); | |
| </script> | |
| <!-- Option 2: Create a shortcode in functions.php --> | |
| <?php | |
| // Add to your theme's functions.php | |
| function myclone_inline_widget_shortcode($atts) { | |
| $atts = shortcode_atts(array( | |
| 'height' => '600px', | |
| 'token' => 'YOUR_WIDGET_TOKEN' | |
| ), $atts); | |
| $output = '<div id="myclone-inline-chat" style="width: 100%; height: ' . esc_attr($atts['height']) . ';"></div>'; | |
| $output .= '<script src="https://app.myclone.is/embed/myclone-embed.js"></script>'; | |
| $output .= '<script> | |
| window.MyClone({ | |
| mode: "inline", | |
| container: "#myclone-inline-chat", | |
| height: "' . esc_js($atts['height']) . '", | |
| expertUsername: "replaceme", | |
| widgetToken: "' . esc_js($atts['token']) . '", | |
| primaryColor: "#6366f1", | |
| enableVoice: true, | |
| }); | |
| </script>'; | |
| return $output; | |
| } | |
| add_shortcode('myclone_inline', 'myclone_inline_widget_shortcode'); | |
| ?> | |
| <!-- Then use in any page/post: --> | |
| <!-- [myclone_inline height="600px" token="YOUR_WIDGET_TOKEN"] --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment