Tag: PHP

WordPress: Create a Custom Meta Box

This is the second entry of my WordPress development series, providing tutorials on specific things you can do in WordPress. Stay tuned for more!

This tutorial is going to show you how to add your own Custom Meta Box to your posts, pages, or your own custom post types. Custom meta boxes allow you to save additional information. Continuing on from the previous tutorial, I am going to add a custom meta box to my custom posts type “Cats”, which I will use to save the cat’s age and favourite toy.

For simplicity, we will create our custom meta box in our functions.php file. You can edit this file by going to Appearance > Editor in your WordPress admin panel, or using a text editor with FTP.

To begin, we first have to create the custom meta box. We do this by using a function we have used already, add_action().

Read More »

WordPress: Create a Custom Post Type

This is the first entry of my WordPress development series, providing tutorials on specific things you can do in WordPress. Stay tuned for more!

I have been working with Custom Post Types recently, so I want to start off the series with them. Custom Post Types are just like Pages and Posts, but you can call them whatever you like. They can be used for a variety of content such as Events, Bands, a Book database, Cars, Recipes… if you can think of it, it can probably be a Custom Post Type! They are handy because you can separate them from your regular blog Posts, they can be integrated into your themes and plugins, and even created just by using functions.php.

For simplicity, we will create our Custom Post Type in our functions.php file. You can edit this file by going to Appearance > Editor in your WordPress admin panel, or using a text editor with FTP. I’m going to be creating a post type called Cats.

Read More »