Contents
Overview
The standard post
fields are the fields available within the wp_posts
table. This table contains post
, page
, attachment
(Media Library) and any Custom Post Types. We are only documenting how to get to the standard built-in fields. Custom Meta is accessed using using wp_get_postmeta
.
List of All Standard Post Fields
ID
– This is the ID of the post in a numerical format.post_title
– Also aliased withtitle
- post_content
- post_content_filtered
post_excerpt
– This is the manually entered Excerpt when you have Excerpts enabled for your post type. This is not the same thing asthe_excerpt
, which is a filter used by WordPress to pull out either the contents ofpost_excerpt
or the first # words in thepost_content
. See the WordPress Codex article forthe_excerpt
.post_author
– This is the ID of the Author of the Post. Not the short username, but the actual ID number that relates to the ID in the User Table.- post_date
- post_date_gmt
- comment_status
- ping_status
- post_password
- post_name
- to_ping
- pinged
- post_modified
- post_modified_gmt
post_parent
– If your post-type is Hierarchical, this is used to define the post that is the ‘parent‘ of the existing post. There isn’t a field to track ‘children‘ of this post. You’d have to query on posts wherepost_parent
is equal to this post’s ID. orpost_parent = {@ID}
- guid
- menu_order
- post_type
- post_mime_type
- comment_count
Accessing using WP Methods
All of the above fields are accessible using WP Standard Methods. You can find most of these directly within the WP Codex, just search the field name. As an example, the_title
outputs post_title
when you are in The Loop; get_the_title
returns the post_title
based on passed Post ID.
Accessing using Magic Tags (Pods Templates)
You can access any of these by wrapping the field name above with {@...}
(replacing the ellipsis with the Field Name). So if you want to output the post_title
within a Pods Template, you’d use {@post_title}
.
Questions
- How do I make the Excerpt Display for Custom Post Types?
Displaying of the Excerpt is handled in your theme by use of
the_excerpt()
function. This function shows either what is in thepost_excerpt
field in your post or it truncates some amount of text from yourpost_content
. The only part of this you would handle with Pods is making sure that the hand-entered Excerpt field is available for your Pods.You can access this under Advanced Options for your post type under Supports, just check the box beside Excerpt:
If you reference this field in your Pods Templates, using the magic tag
{@post_excerpt}
it will show the actual value in the hand-entered Post Excerpt, not the results ofthe_excerpt
function.