Skip to main content

Post Source

A Current Post field reads from the post being viewed: the page itself, or the post of the Query Loop item it sits in. The Row block's Post source setting changes that for everything inside the row. Set it to the latest post of a post type, or to one post you pick, and every Current Post field in the row reads from that post instead. This includes the row's own fields and every block inside the row at any depth. Dynamic background images follow the row's post too, as described under Dynamic backgrounds.

A typical use is a featured section on the home page that always shows your newest project, with its title, featured image, a few custom fields and a link. You set the rule once on the row instead of on each field, and the section updates by itself when you publish a new project.

Setting the source​

Select the Row and open the Layout tab in the block settings. The Post source panel has a Source setting with three options:

  • Inherit: the default. The row reads from the post around it, which is the page, a Query Loop item, or a row above it that has its own source. Existing rows use this and keep working as before.
  • Latest post: the row reads from the newest published post that matches the options below.
  • Pick a post: the row reads from one post. Search for it by title or ID. Any published post of a public post type can be picked.

Changing the source doesn't change the blocks inside the row. Their fields stay as you set them and read from a different post.

Latest post options​

  • Post type: where the post comes from, for example Posts or a custom post type such as Projects.
  • Category: limits the choice to one term of a taxonomy that belongs to the post type. Leave it on Any category to use every post of the type.
  • Skip: how many of the newest posts to pass over. 0 shows the newest post, 1 the second newest, and so on. Three rows set to 0, 1 and 2 show the three newest posts.
  • Leave out the page's own post: on by default. When the page being viewed is itself a post of the chosen type, the row shows another post instead of repeating it. For example, a "Latest project" section on a single project template never shows the project the visitor is already looking at.

Posts are ordered by publish date, newest first. Sticky posts get no special place. Drafts, scheduled, private and password protected posts are never shown.

The Showing line​

Below the options, Showing: names the post the row reads from right now. In the editor, the blocks inside the row preview that post's real data. This also works in a Global Section, where Current Post fields otherwise show placeholders.

Nested rows​

A row with a source can sit inside another row with a source. The innermost source wins: blocks inside the inner row read from the inner row's post. Blocks in the outer row that come after the inner row read from the outer row's post again.

A row with a source inside a Query Loop item works the same way. It reads from its own source instead of the item's post.

When no post matches​

If nothing matches the source, the row doesn't appear on the site. This happens when the post type has no published posts yet, when the chosen category is empty, or when a picked post is unpublished or deleted. In the editor the row stays visible, with a note in the row and in the panel saying it won't show on the site.

Fields the post doesn't have​

A field remembers the name of the field it reads, not the post type it came from. If you switch the source to a post type that doesn't have some of the ACF fields used inside the row, those fields show nothing on the site.

When that happens, the panel lists the missing fields, for example: "These fields aren't on Posts, so they'll show nothing: Area, Finished in, Town & country". In the editor, a Text block shows a missing field as its name in brackets with a dashed outline. Switch the source back, or use Undo, to bring the values back.

Dynamic backgrounds​

A dynamic background image normally uses the Background output, which fills in the image once for the whole page. Inside a row with a source, every dynamic background shows the image of the row's post instead. This covers the row's own background and every block inside the row. You don't need to change any settings.

For Row, Column, Flex Box, Milestone and Image Grid blocks, the background is output as an Image to do this. Image output can't repeat or take a custom size, so a background set to repeat or to a custom size covers the area instead. The focal point and the Contain size are kept.

Text and Image Gallery blocks keep the Background output, so all of their background settings still apply.

Page caching​

The row looks up its post each time the page is built. If your site uses a page cache, a cached page keeps showing the old post after you publish a newer one, until the cache expires or you clear it.