This tutorial provides a simply beginners guide about how to create a plugin which automatically executes your custom functions.
This enables you to store all your custom PHP code in a plugin and use it when changing to any theme.
On top of this, all your custom functions are saved and not over written when your parent theme updates or in some cases, when your child theme is updated.
Here’s the step by step instructions about how to create your own custom functionality plugin:
1. Using a code editor like Notepad++, create a new file and add the following code:
2. Name the file something like custom-functions, save it as a PHP file and save it to your desktop.
3. Create a new folder in your wp-content directory named mu-plugins
4. Upload your custom-functions.php file to your new mu-plugins folder.
Now you can go to Plugins > Installed Plugins > Must-Use and you’ll see your plugin which is automatically activated.
You can then access your custom-functions.php file and add/remove/modify your custom PHP code using FTP.