This field type requires the Genesis Custom Blocks Pro plugin which is available through a Genesis Pro subscription.
The Post field allows you to select one of your WordPress® posts from a searchable dropdown menu.1

Click image to enlarge
- Field Label: The field label will be displayed next to the field when adding it the block to the post or page.
- Field Name: The field name should auto-fill based on the field label, but can be customized. This will be used in the PHP as part of the block template.
- Field Type: Choose the Posts field type.
- Field Location: Choose a location to display the field.
- Editor will show the field in the main editing area of a post or page.
- Inspector will display the field in the right-hand sidebar under the block inspector.
- Field Width: Select how widely the field should be displayed.
- Help Text: Enter instructions to describe the data needed in the field. (optional).
- Post Type: The post type filter (e.g. Posts, Pages, or a custom post type).
Note: For a custom post type to display in the editor, when it is registered with register_post_type(), show_in_rest must be true. This is because the block editor uses the REST API.
PHP API Controls
- name
- label
- control
- type
- order
- location
- width
- help
- post_type_rest_slug
Template Usage
To display the Post field in your template with a link to the post, use the field name you provided.
There are two ways you can do this.
- Template Editor: Using the built-in template editor is the easiest way to create the required block template. The template editor accepts HTML markup, field names (enclosed in 2 brackets), and CSS only.
Here’s an example of HTML you can use in the template editor:
<h2>{{consider}}</h2>
Note: In the Template Editor, the Post field will render the title of the post. For anything else, like getting the post ID or permalink, please use PHP templating method described below.
- PHP Template: If you need to use logic, loop syntax, define variables, or use PHP, you can create the template manually using the PHP templating method instead.
For example:
<a href="<?php echo get_permalink( block_value( 'consider' )->ID ); ?>">
<?php block_field( 'consider' ); ?>
</a>
The API will return a WP_Post object, and echo the Post’s title. (See the WP_Post class for details.)
Example template file /blocks/block-example.php
<?php
// Example Post Field
<a href="<?php echo get_permalink( block_value( 'consider' )->ID ); ?>">
<?php block_field( 'consider' ); ?>
</a>
Block Usage
To use the block with the Post field on your site, locate it in the blocks menu.

Click image to enlarge
It will then display within your post or page editor where you can choose from the dropdown list.

Click image to enlarge
And on the front end of your site.

Click image to enlarge
You can also take advantage of the WP_Post object and return additional information.
<?php
// Example Block
?>
<h3>You might also consider:</h3>
<a href="<?php echo get_permalink( block_value( 'consider' )->ID ); ?>">
<?php block_field( 'consider' ); ?>
</a>
<?php
$post = block_value( 'consider );
$post_img_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
$post_img_alttext = get_post_meta( get_post_thumbnail_id( $post->ID ), '_wp_attachment_image_alt', true );
?>
<div>
<img
src="<?php echo $post_img_attributes[0]; ?>"
width="<?php echo $post_img_attributes[1]; ?>"
height="<?php echo $post_img_attributes[2]; ?>"
alt="<?php echo $post_img_alttext; ?>"
/>
</div>
And on the front-end of your site.

Click image to enlarge
