This will be a bit of a tutorial on how to use the Pods Framework plugin to create, manage, and display custom post types in WordPress.
First: Why use Pods as opposed to other options? One reason I like Pods is that you don’t have to write out a whole bunch of boilerplate code and create custom page templates to display your custom posts (although you certainly can if you want or need that depth of template customization). Pods also provides more flexibility by allowing you to use separate database tables to contain your custom post type as opposed to stuffing everything under the WordPress meta table (the default WordPress Custom Post Type behavior or like most other custom post type plugins).
So Step 1 install and enable Pods on your WordPress installation. (You don’t need a screenshot for this do you?) I would recommend you do this on a local development install first so you can get an idea of what’s happening before trying it on your site.
Step 2 – Configure your Pod and enable some useful components.
I recommend enabling Advanced Relationships, Packages (import and export your Pods – great way to test locally and then import into your live environment), and Templates.
Step 3 – come up with a great idea for a custom post. In my case, I wanted some functionality where we could manage a team by adding and removing members and displaying pertinent information about individual members.
Step 4 – Create a new Custom Post Type using Pods (under the Pod’s Admin, select Add New).
Pods will ask you to fill in some information – don’t worry, you can always come back and update things after you’ve created it. In our case it will ask what type of object you’re creating (Custom Post Type (CPT), Custom Taxonomy, or even custom Settings Page). Select CPT (Custom Post Type).
Fill in the labels – the single label is what a single item will be called, the plural is what multiple items will be labeled. If you have enabled Pod’s Table configuration you can select the Advanced setting and configure it so your Custom Post Type will use it’s own database table (as opposed to using the meta-based which is WordPress’ default). Be aware of the pros and cons of using this feature – a separate database table means more calls to the database but with the additional flexibility that can come from having a separate table.
Step 5 –
Now it’s time to add in Fields for your Pod. Fields are a way to capture the information you want that relate to your Custom Post Type. In my case I want to capture the Name, Job Title, Email, and Photo. The id field I included as a way to query for the slug ID of the post – basically it’s useful info for behind the scenes and not used in the public display. I’ll cover why I did that later in this post.
Please note the Name column – this is the name/ID that you’ll use when pulling and displaying data from an individual item in your Pod.
Okay we’ll call it quits here (this post is getting fairly long and heavy with images). I’ll pick it up in the next post.