I've been silently doing a lot of minor and medium size changes to News47ell since the redesign. With those changes, I had to find a way to keep my code as organized as possible so that I can understand it when I go back to it later along the road. Because I use WordPress, I decided to convert all my code into Site Specific WordPress Plugin.
Each plugin does a specific thing on the site and it includes a PHP file, JS file & CSS file. They are all served from my server over at Lightning Base so I can reduce the number of HTTP requests required to render the page.
Recently, I was going insane with WordPress plugins, creating new ones each and every day to use them on this site.
I created plugins for adding things like:
- Prisim Syntax Highlighter
- Tagline Randomizer
- Lyrics in Footer Randomizer
And much, much more in an effort to build something I like, keep everything organized, under control and, at the same time learn from it.
Now, you will learn How to Create Site Specific WordPress Plugin
With 5 easy steps you will have your first WordPress Plugin in no time, Here's how:
Create an empty folder and name it something that you can remember.
Open Sublime Text or your text editor of choice and paste the following:
<?php /* Plugin Name: Name of the plugin Description: Description of the plugin Version: Version number of the plugin Plugin URI: Website of the plugin Author: Name of the plugin author Author URI: Author's website */ /* Start Adding Functions Below this Line */ /* Stop Adding Functions Above this Line */ ?>
Save this file as .php file, name it something you can remember and put it inside the folder from step 1.
Zip the entire folder and upload it to your plugins folder in
Activate the plugin & That's it.
Congratulation! You just created your first Site Specific WordPress Plugin.
Now it's up to you and your coding skills to fill that core .php file with all the functions that your heart desire that will do all kind of crazy things to your WordPress site.