1. Support
  2. Knowledge Base
  3. Extending & Styling
  4. How-to use custom PHP code snippets

How-to use custom PHP code snippets

There might be a situation where you need to use some custom PHP code snippets on your site.

This could be done by adding the code into the functions.php of your child-/theme. Unfortunately, after changing your theme, your snippets will be gone too.

Alternatively, you could create your own plugin and collect those snippets inside. Of course, this requires deeper technical programming knowledge.

The easy way of handling PHP code snippets

We recommend making use of a plugin called Code Snippets which is available for free.

After you installed and activated the plugin, you can find a new menu entry called “Snippets” on your left. Here you can add multiple snippets, control where the snippet should be executed, assign a title and description.

Additionally, you can easily deactivate snippets in order to pause their execution, without deleting them completely.

Was this article helpful?

Related Articles

Stay in touch with us!

Join our newsletter and we let you know about new theme releases,
as well as important updates and discounts.

Latest news from our blog: Our Plans for MH Themes & MH Magazine in 2024 (25. April 2024)