Post Dynamic Content

In this article we're going to explain how to use Post Dynamic Content.

  1. Current Post vs. Original Post
  2. Title
  3. Excerpt
  4. Featured Image
  5. Featured Image URL
  6. Publish Date
  7. Publish Time
  8. Modified Date
  9. Modified Time
  10. Comment Count
  11. Comment Link
  12. Permalink
  13. Slug
  14. Status
  15. Post Type Name
  16. Post Type Name Plural
  17. Post Type URL
  18. Meta (Custom Field)
  19. Classes
  20. ID (Attribute)
  21. ID (String)
  22. ID (Numeric)
  23. Parent ID
  24. Is Sticky
  25. See Also

Posts in WordPress include Posts, Pages, and any Custom Post Type set up in your WordPress install. All Post Dynamic Content are configurable from the "Cog" icon in the Dynamic Content UI. The choices are as follows.

  • Current Post
  • Next Post
  • Previous Post
  • Parent Post
  • Original Post (the Post the current URL is for, ignoring any active Looper).
  • Specific Post (will add a new input to input the specific Post ID to use).
Post Title Dynamic Content UI

Current Post vs. Original Post

"Current Post" follows whatever Post is active at that point in the render. Inside a Looper, that is the Post for the current loop iteration rather than the Post being viewed.

"Original Post" always resolves to the Post the current URL is for, regardless of any Looper that has changed the active Post. This is useful when you are looping over related Posts but still need a data point from the Post the visitor is actually on — for example, showing the title of the Post being viewed above a Looper of its child Pages.

If the current URL does not resolve to a Post (an archive or search results page, for example), "Original Post" falls back to the Page set as your static front page under WordPress > Settings > Reading, if one is set.

Title

{{dc:post:title}}

This outputs the Title of the Post.

Excerpt

{{dc:post:excerpt}}

This outputs the Excerpt of the Post. This can be changed in Cornerstone in the Settings area of the Post you are working on if the Post type supports excerpts.

{{dc:post:featured_image_id}} {{dc:post:featured_image_id size="thumbnail"}}

This outputs the featured image attachment ID. The size argument can change the image size which is based on your WordPress image sizes setting. Image based controls in Cornerstone will automatically convert attachment IDs to URL if the element needs to.

{{dc:post:featured_image}}

This outputs the featured image as a URL.

Publish Date

{{dc:post:publish_date}}

This outputs the Posts publish date.

Publish Date

{{dc:post:publish_date}} {{dc:post:publish_date format="F j, Y"}}

This outputs the Posts publish date. There is a control to change the date format, and you can see a full list of available characters to use((https://www.php.net/manual/en/datetime.format.php).

Post Publish Date Dynamic Content UI

Publish Time

{{dc:post:publish_time}} {{dc:post:publish_time format="H:i"}}

This outputs the time in which the Post was published (EX: 8:35pm). The format can also be controlled much like the Publish Date.

Modified Date

{{dc:post:modified_date}} {{dc:post:modified_date format="F j, Y"}}

This outputs the Posts modified date. The format can also be controlled much like the Publish Date.

Modified Time

{{dc:post:modified_time}} {{dc:post:modified_time format="H:i"}}

This outputs the time in which the Post was modified (EX: 8:35pm). The format can also be controlled much like the Publish Date.

Comment Count

{{dc:post:comment_count}}

This outputs the number of comments on a given Post.

{{dc:post:comment_link}}

This outputs a link to where the Post can be commented on. This is usually a hash anchor that scrolls the page to the area where you can comment.

{{dc:post:permalink}}

This outputs the full URL to view a Post. This can be particularly helpful to link to a Post from another Page or Post.

Slug

{{dc:post:slug}}

This outputs the URL slug of a Post. This is based on your WordPress > Permalink setting.

Status

{{dc:post:status}}

This outputs the Post status. The status is usually either going to be publish or draft however custom post types or plugins can set this to any number of things.

Post Type Name

{{dc:post:post_type}}

This outputs the Post type name.

Post Type Name Plural

{{dc:post:post_type_plural}}

This outputs the Post types plural name. Example Posts would be the plural name of Post.

Post Type URL

{{dc:post:post_type_url}}

If a post type has an archive, this will output the URL to that post type archive.

Meta (Custom Field)

{{dc:post:meta key="meta_key"}}

This grabs a meta value from the postmeta table. Meta values can be any number of things, but are mostly used by plugins to add additional data to WordPress. There is a meta control to select the meta key you wish to use. There is also a "Custom Key" which you can input the key manually or use Dynamic Content to grab a dynamic meta value. There is also a control called Multiple. Meta values can be used more then once, and this would grab all available meta values set to a particular key.

Post Meta Dynamic Content UI

Classes

{{dc:post:classes}}

This outputs the CSS classes assigned to a Post. This is primarily used in the WordPress Block Editor. Outputting this to a Div Element's Class control would be useful in a Single Layout.

ID (Attribute)

{{dc:post:id_attribute}}

This outputs the ID along with post- as the prefix. Example Post ID 20 would output post-20.

ID (String)

{{dc:post:id}}

This outputs the ID string value of a Post.

ID (Numeric)

{{dc:post:id_number}}

This outputs the ID integer value of a Post.

Parent ID

{{dc:post:parent_id}}

This outputs the parent Post ID.

Is Sticky

{{dc:post:is_sticky}}

This will output true or false whether a post is sticky. This can be used in a condition to add a special Element(https://theme.co/docs/elements-overview on your content if a Post is sticky.

See Also

See something inaccurate? Let us know