Before we get started, lets actually make sure that our plugin is setup properly.
First we are going to add some code to the plugin which simply outputs ‘Hello’. Next we will move the folder to the wp-content/plugins directory. Finally, we will activate our plugin and check for the ‘Hello’ on our webpage.
First add the following code to the bottom of your .php file.
add_action( 'wp_head', 'gerrg_say_hello' );
If you are not familiar with the WordPress Plugin API, in the code above we are simply adding an action to a hook. A action is simply a function, a hook is a SPOT in the code where that function will run.
Above we are adding our gerrg_say_hello function to the wp_head hook. The wp_head hook is triggered between the <head></head> section of the website.
Simply put, we expect to see ‘hello’ at the top of our webpage.
Activating your plugin
It’s very likely you already know how to activate a plugin. First we need to move our folder into the wp-content/plugins directory of our web server.
There is more than one way to do this and I leave it to you get accomplish this task.