Pods CPTs versus ACTs – coding for them

One of the biggest areas of confusion with most people jumping in to pods is the difference between CPTs (Custom Post Types) and ACTs (Advanced Content Types). Pods lets you create and extend other content types as well, but these two are the most common and the most commonly confused.

The Pods team has actually created a really great comparison chart for you which I highly recommend looking over either before you decide which one you need or if you are stuck or confused after already creating one or the other. The thing is, while that is a great chart that shows you the features of using each, it can be overwhelming and not give you the whole picture in terms of coding for them.

When to use CPTs

I prefer to use CPTs when the content I will be entering is somewhat of an article and not just a piece of data. I consider WordPress’ post table a good place to maintain a list of articles. Articles could be anything from pages, blog posts, news items, or recipes. To me, they are generally things that I would consider working in to the main blog feed or at least they would not be completely out of place in such a feed. For instance, I used Pods to extend a CPT called “Fitness Tips”. These are mini articles written weekly. They are separated in to their own page but they could easily be pulled right in with all blog posts and it would feel logical.

Pulling in CPTs
Now here is the kicker. There is nothing inherently special about pulling in content from a CPT created by Pods. It is exactly the same as pulling in content from any CPT.

Instead of dealing with Pods Pages and Pods Templates and such, you simply treat it like a normal Custom Post Type and create a custom template using WordPress’ template hierarchy tree for reference. So if you created and extended a CPT called ‘recipes’ using Pods, you can simply create single-recipes.php and WordPress will use that as the template to display the content of that CPT.

With that being said, you then build your loop the same way you build ANY loop for CPTs and pull in the additional fields using get_post_meta() where the $key is the name of the field you added via pods.

It is really that simple. A lot of people make it harder than it should be, and that is why I have written this blog post.

When to use ACTs

I tend to use ACTs when the data I am wanting to store does not fit in to a news or article style format. Typically I consider this more “tabular” data versus news stream information.  This is data that typically would not have the typical WordPress post fields such as title and content and instead would be more like a list of unique fields that make up this piece of data. One example I use quite often is when I use ACTs to build an easy to manage UI for content sliders. When you think about a single slide in a slider, would you put that in the realm of posts as well? Is it a piece of data that would be well suited to the posts UI or would it be better off as a list of fields represented as a form. For me, the slide fields are best displayed as a form with a name, image, tag line, and link-to fields and individually they would not make any sense fed in to the main WordPress posts feed. Other examples would be an employee database or a list of houses for sale.

Coding for each is not the same

This is where the confusion comes in. Pulling Pods ACTs in to your theme is very simple albeit very feature rich but also quite different from what we are used to when working with WordPress’ loop. Pulling in Pods data requires that you create code to query your new table using the $myvariable = pods (‘mypodname’); This is a step you do not have to do with traditional WordPress posts because of how the loop is created.

Pulling in ACTs
There are a number of tutorials that show you all of the different ways you can pull Pods ACT content in to your WordPress theme. You have a number of tools such as Pods Pages, Pods Templates, and even WordPress Pages to use in pulling in and displaying these items and it would be up to you to decide which is best. When I first started using Pods I was consistently using the Pods Templates but have since switched to writing my code inside of a WordPress Page Template and simply choosing that page template from the drop down select on my Pods Page.

Useful links:

Pulling Pods into your Theme using pods pages and templates
WordPress Template Hierarchy
Content Type Comparison Chart
Displaying Pods Data – A Tutorial


About The_Idiot

Self made millionaire.. Oops I mean web developer.. who started out learning how to build websites with tables and dreamweaver, I now almost entirely focus on CMS-based development, usually WordPress. I love coding and designing and regularly switch between my left and right brains.

2 thoughts on “Pods CPTs versus ACTs – coding for them

  1. Kevin

    I followed the tutorial, literally cutting/pasting the instructions in, and all I get is blank page with no content.  Is this article outdated or am I an idiot?

  2. […] it is applied to a custom post type, you use the normal WordPress-y way of getting that content! No special Pods code required for this at all! […]

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">