Advanced Custom Fields – Relationship

[ad_1]

I have a custom post type with a relationship field (block). I’m able to select other posts of the same post type. However, on the frontend:

* Return Post Object: Only the title and permalink of the selected post shows, none of the custom fields do.
* Return Post ID: Shows the fields of the current post

I’m following what’s in the docs, but it’s not working. Any help or advice is appreciated.

[ad_2]
1 Comment
  1. If you return the post object… You can add the post ID of the object in get_field

    Of the top of my head,

    $object = get_field(‘relationship’); get_field(‘field_name’, $object->id)

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer