WordPress
Add the script site-wide, then drop an AI box into any page.
- 1Add the script tag to your site's footer. Use your theme's custom code setting, or a header-and-footer code plugin.
- 2On the page where you want AI, add a Custom HTML block.
- 3Paste the box below into it and publish.
Footer code
<script src="https://cdn.chargemy.ai/v1/charge.js"></script>
Custom HTML block
<textarea id="cm-text" rows="5" style="width:100%"></textarea>
<button id="cm-go">Summarise</button>
<p id="cm-out"></p>
<script>
document.getElementById('cm-go').onclick = async function () {
var out = document.getElementById('cm-out')
var reply = await charge.ai.chat('Summarise: ' + document.getElementById('cm-text').value)
out.textContent = reply.text
}
</script> Then claim your site in the console so the earnings come to you.
Read next
Still stuck? Talk to us and we'll help.