My first plugin and custom post type

Knowing that I want to have custom post types for different types of content, I set out finding the best way create custom posts.  Plugins seem to be the easiest way to add custom post types, but the WordPress codex didn’t seem to give me all of the answers I needed.  I was understanding how some of the code worked, and that it needed hooks.  I wasn’t entirely sure what code to edit or whether I should make new files or change existing ones.  I didn’t know whether this was a content or an admin issue, as the posts usually come from the dashboard.

Plugins made this simpler, as I discovered that I could just make a whole new file in wp_content/plugins, and not be at risk of screwing up any of the other files.  I also decided to look at some examples and use a template of some code, just so I could get something working and not have to start from scratch.  There are so many pieces to custom post types; it really helps to look at what some other people have done in order to get it working right.

After following the WordPress codex and a great article about plugins and custom post types I saw here, I was actually able to see my plugin, working, on my local site, which felt like a big accomplishment after spending hours reading and looking at tons of code and step-by-step instructions.  I activated the plugin and saw my custom post type show up in the sidebar, allowing me to click on it and start typing.  Although it currently has the same functionality as the regular post, I’m exciting that its working.  Now the next step is to learn more about meta-boxes and figure out how exactly to get my custom post type to do what I want it to do.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.