How to Add a Snippet (PHP or JS)

Many of our documentation articles involve using custom code snippets. Here is how to add a snippet to your site safely and easily.

1. Install and activate this free plugin:

By using the plugin above, you can add snippets safely without having to worry about errors or breaking the site.

2. For JavaScript snippets, go to Snippets -> All Snippets -> Example JavaScript Snippet:

Enable the snippet and click EDIT

Then you can copy and paste the snippet itself here:

Click "Save Changes" and that's it.

3. For PHP snippets, go to Snippets -> Add New.

Then copy and paste the code here:

Click "Save Changes" and that's it.

Powered by BetterDocs