Post Content – core/post-content

Displays the contents of a post or page.

Use the Post Content block to display the contents of a post or page or any other custom post type.

Screenshot

Post Content block screenshot.

Example

This example shows the Query Loop displaying the latest post. The Post Template block displays the Post Title, the Post Content and the Post Date.


  • WordPress 6.0.2 now parsed

    WordPress 6.0.2, a security and maintenance release, was made available on 30th August 2022. It has now been parsed on core.wp-a2z.org.

    (more…)


Notes

  • The Post Content block is intended for use in Templates and Template parts.
  • It can also be used in the Post Template block within the Query Loop block.

Recursion detection and prevention

  • The Post Content block is one of those blocks that can go recursive.
  • This was a known issue in Gutenberg 9.x
  • I created a Post Content block automatically and it all went tits up with Gutenberg 10.0.0
    • I thought it had been fixed.
    • I must have been mistaken.
    • I’ve updated the issue WordPress/gutenberg#26923.
    • The issue is still open, though work has been done to improve the behaviour.
  • Gutenberg does now contain some recursion detection logic.

Within the block editor

If used in normal content the block will display a message

On the front end

When the Post Content block is rendered on the front end you get.

Content not available; already processed.
130281
core/post-content
core/post-content 130281