WordPress Post¶
The placeholders described on this page refer to WordPress Post properties. These placeholders contain the values of the WP Post on which the template is included.
Note
To use these placeholders, the option “Enable WP Post placeholders” must be enabled! See Enable WP Post placeholders.
Note
If you are working with these {{ post.* }} placeholders, remember to enable option Consider Post ID in ASA2’s option tab “Cache”.
For more information about the properties of the WP_Post object, please refer to https://codex.wordpress.org/Class_Reference/WP_Post.
Debug template¶
If you want to check the contents of the post placeholders on a page, you can use this ASA2 template.
<div class="asa2_wp_post_dump">
<p>Product title:<br><b>{{ Title }}</b></p>
<p>Post values:</p>
<table><thead><th>Placeholder</th><th>Value</th></thead><tbody>{% for key, value in post %}
<tr><td>{{ '{{ post.' }}{{ key }}{{ ' }}' }}</td><td>{% if value is iterable %}{{ dump(value) }}{% else %}{{ value }}{% endif %}</td></tr>
{% endfor %}</tbody></table>
</div>
{{ post.ID }}¶
The ID of the current Post.
{{ post.post_date }}¶
The post’s local publication time.
{{ post.post_date_gmt }}¶
The post’s GMT publication time.
{{ post.post_content }}¶
The full content of the post
{{ post.post_title }}¶
The title of the post
{{ post.post_excerpt }}¶
User-defined post excerpt
{{ post.comment_status }}¶
Returns the post’s comment status: open
or closed
.
{{ post.ping_status }}¶
Returns the post’s status: open
or closed
.
{{ post.post_name }}¶
The post’s slug.
{{ post.to_ping }}¶
{{ post.pinged }}¶
{{ post.post_modified }}¶
The post’s local modified time.
{{ post.post_modified_gmt }}¶
The post’s GMT modified time.
{{ post.post_content_filtered }}¶
{{ post.post_parent }}¶
Parent Post ID (default 0)
{{ post.guid }}¶
The unique identifier for a post, not necessarily a URL, used as the feed GUID.
{{ post.post_type }}¶
The post’s type, like post or page. See https://codex.wordpress.org/Post_Types
{{ post.post_mime_type }}¶
An attachment’s mime type.
{{ post.comment_count }}¶
Number of comments on post (numeric string)
{{ post.filter }}¶
{{ post.ancestors }}¶
{{ post.page_template }}¶
{{ post.post_category }}¶
The post’s categories (Array of IDs).