Post Dynamic Content

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

  1. Title
  2. Excerpt
  3. Featured Image
  4. Featured Image URL
  5. Publish Date
  6. Publish Time
  7. Modified Date
  8. Modified Time
  9. Comment Count
  10. Comment Link
  11. Permalink
  12. Slug
  13. Status
  14. Post Type Name
  15. Post Type Name Plural
  16. Post Type URL
  17. Meta (Custom Field)
  18. Classes
  19. ID (Attribute)
  20. ID (Numeric)
  21. Parent ID
  22. Is Sticky
  23. 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
  • Specific Post (will add a new input to input the specific Post ID to use).
Post Title Dynamic Content UI

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 (Numeric)

{{dc:post:id}}

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