Your first snippet
This adds a line of text to the footer of every page.
- Go to Snipfire → Snippets and click + New.
- Choose PHP in the type picker.
- Paste this:
add_action( 'wp_footer', function () {
echo '<p>Hello from my first snippet.</p>';
} );
- Give it a name, then click Save (or press Ctrl/Cmd+S).
- Turn on the Active switch.
Open your site: the line is at the bottom of the page.
What just happened
- When you saved, Snipfire checked the code for syntax errors. A broken snippet isn't saved until you fix it, and the problem is marked on its line.
- When you switched it on, Snipfire test-loaded your site with the snippet. If that had failed, the snippet would have gone straight back off.
- If it fails later, for example only on one page, Snipfire switches it off and shows a notice with the exact line.
Tip: type
add_action( 'and pick a hook from the list. The editor writes the whole callback for you, with the right parameters.
Next: Safe mode.
Something unclear or missing? Tell us