Post Reference Field

Point to a single post, page or custom post type entry.

The Post Reference field points to one post, page or custom post type entry, picked in a searchable dropdown.

To select several posts and order them, use the Relation field of Modern Fields Pro.

Configuration

Go to Modern Fields > Fields groups and add the Post Reference field. Its settings are in the inspector:

Effect
Searchable post typesThe post types the search looks into.
Searchable statusesThe publication statuses the search looks into. Published only by default: unpublished content is listed to the users allowed to edit it.
The Post Reference field settings

Display the post

The field stores the ID of the selected post. Read it with get_field():

PHP

Read the relation backwards

To show the relation on the post being pointed at, and edit it from there, add a Reverse Relation field to a group placed on those posts, and choose this field as its source. Nothing is to be switched on in the Post Reference field itself.

In a template, pass the name of the Post Reference field to modern_fields_get_linked_posts(): it returns the IDs of the posts pointing at the current post, or at the post given as second argument.

PHP

A field no Reverse Relation field names returns an empty array, unless its Record the reverse relation option was switched on before Modern Fields 1.6.0, or by the ACF Migration: it then keeps recording the reverse relation, and its Bidirectional panel shows the option until you switch it off.


Range Field