Once you’ve defined a post type relationship and added content to your child post fields, you will be ready to display it. There are two ways to do this:

Let’s take a look at both.

Using Views

We have added a filter into Views so that you can easily display content. Create a new View and then in the Query Filter section click on Add a filter. From the dropdown menu select Post relationship->Post Type is a child of.

Selecting a parent for a child view

There are three conditions that you can choose from here:

  • Post where this View is inserted – this will display posts that are the children of the post type where the View is inserted. I.e. if it’s inserted into a Page the results will be post types that are the children of that page
  • Post set by the Parent View – if the View is inserted into another View, this will output based on the parent View
  • Specific – use to output the child posts of a specific piece of content.
  • Post with ID set by the shortcode attribute – if you use a shortcode to display the output of the View, this can be passed as shortcode attribute.
  • Post with ID set by the URL parameter – this will output based on a URL parameter when viewing the content on the front-end.

You can then set up the rest of your View as usual. To see a practical example of using a View to output your fields table content, check out this tutorial for displaying rooms belonging to a Real Estate listing.

Using the Types API

If you’re a developer you may want to use the Types Fields API to display your content. Learn more on how to display child post contents using PHP.