This guide explains how to package custom Quform code into a small WordPress plugin. This is the advanced option. For most users, a code snippets plugin is easier. See Adding custom code for an overview of all the ways to add custom code to your site.
Why use this method? It’s useful when you have a lot of custom code, or you want it to stay active regardless of which theme is in use. Because the code lives in its own plugin, it’s not affected by theme updates, and you can deactivate all of the code at once by deactivating the plugin.
Create the plugin
Create a new folder on your computer named quform-custom-code. Inside it create a new text file called quform-custom-code.php and add this code inside the file:
1 2 3 4 5 6 7 8 9 | <?php /* * Plugin Name: Quform Custom Code * Description: Custom code for Quform. * Version: 1.0 */ // Paste in your custom code below |
<?php /* * Plugin Name: Quform Custom Code * Description: Custom code for Quform. * Version: 1.0 */ // Paste in your custom code below
On line 10, paste in the code from the guide you were following.
Install the plugin
Zip up the quform-custom-code folder, then install it like a normal WordPress plugin at Plugins → Add New → Upload.
Go to the Plugins page within WordPress and activate Quform Custom Code. That's it!
Alternatively, you can install the plugin using FTP software such as FileZilla. Connect to your web server, go to the wp-content/plugins folder, and upload the quform-custom-code folder there.
