Home › Forums › Gutenberg › Gutenberg Relationship field, can't get title from another block › Reply To: Gutenberg Relationship field, can't get title from another block
In the problem line:
<?php
<p class="project-subject"><?php echo the_field('top_post_content')['title']?></p>
you may want to replace the_field with get_field, or omit echo.
I take it, top_post_content refers to a post. In the back-end you can pick if you want the field to return a post object or merely the post ID, in which case it will not return the title. You could use:
<?php
get_the_title( get_field('top_post_content') )
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.