How to add custom code snippets

Adding PHP snippets

PHP snippets are responsible for custom functionality and logic, for example, changing how a feature behaves or adding new behavior to your site.

We recommend using the Code Snippets plugin to add and manage custom PHP snippets safely, without editing your theme’s core files directly.

Adding CSS snippets

CSS snippets are responsible for custom styling and appearance, for example, changing colors, spacing, or layout.

You can add custom CSS snippets in the Appearance > Customize > Additional CSS section.

Using a child theme

If you have some coding experience and plan to make the advanced customizations to your site, we recommend creating a child theme. This lets you add custom PHP snippets to the child theme’s functions.php file, and custom CSS to its style.css file, keeping all your changes safely separated from the parent theme.

You can try using a plugin like this one to generate a child theme in a few clicks. Once the child theme is generated, remove or deactivate the plugin, as it’s no longer needed.