There are three popular ways to add a piece of code to your WordPress site:
The most common approach is to add the code to your theme's
You can do this in Appearance → Editor.
More information about the functions
Instead of putting everything in
functions.php, you can create a basic plugin
that contains your custom code. This way you won't lose your customizations when you change
or upgrade your theme.
This plugin provides an easy way to add and organize code snippets without having to edit any files. It also supports code import & export.