How to add a Code Snippet (PHP or JS)

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

1. Install and activate this free plugin:

Code Snippets

You can easily find it by going to Plugins -> Add New:

2. Go to Snippets -> Add New and paste the snippet into the code area:

3. Scroll down and click on "Save Changes and Activate"

That's it!

Note: You can also add code snippets to functions.php of the child theme, or by using the WPCode plugin if you are more familiar with those methods. The above is just an example, other methods work as well.

Powered by BetterDocs