logo

WordPress Plugin tutorial part 2 The Header

logo

Ok so lets get started. create a file with your text editor. Add the following text to the very top of the file.

<?php
/*
Plugin Name: Author Plug
Plugin URI: http://MyBlogIt.net/plugins
Description: Displays a short bio and image for each author above or below each post.
Version: 0.5
Author: David Span
Author URI: http://davidspan.com/
*/
?>

Plugin Header

What we have just done is add our plugin’s header to the file. This information will be displayed within the plugin page of WordPress. Now save this file to your plugin directory with the name author_plug.php.

Congratulations, you have just created your first working plugin. If you go to your plugin page within your WordPress dashboard you can activate it.

Of course it does nothing at this point you can leave it active as you work on it. With what we are going to be doing it will not harm your WordPress installation.

Other Files

If your plugin requires other files you can include them in the plugin directory as well. Just do not include the header within them. You can also put your plugin in it’s own subdirectory as well. As long as your main plugin file has the plugin header WordPress will find it.

Final Note

Whenever your working with php it’s a good idea to have no white space before your open php tag. Doing so can cause php header errors.

4 Responses to “WordPress Plugin tutorial part 2 The Header”

  1. WebGyver says:

    David,

    I love your series on WordPress-related do-it-yourself projects. Great stuff, especially your comments about PHP. Keep up the good work, and I’ll be coming back for more on a regular basis.

  2. David says:

    Thank you WebGyver.

  3. watchfights says:

    Hi all great information here and good thread to comment on.

    Can I ask though – how did you get this picked up and into google news?

    Very impressive that this blog is syndicated through Google and is it something that is just up to Google or you actively created?

    Obviously this is a popular blog with great data so well done on your seo success..

  4. Rend says:

    Were you going to make a part 3 and finish off this series?

Leave a Reply

CommentLuv badge
logo
logo
Powered by Wordpress | Designed by Elegant Themes