ACF Relationship - Get Parent's Post Object

I've a few post that have ACF relationship field set up :

- Post A
- Post A1
- Post A2
- Post A3

Post A have a relationship that link to : Post A1,A2 A3...

Post A1,A2,A3 have their own post templates,

But inside the post templates, can I manage to get Post A's Title?

Because I don't want hardcoded Post A's title on Post A1,A2,A3's fields.

I'd tried this solution, but seems can't retrieve parent A's post object...

Below is my custom field settings on Post A's category, to select children products relationship ( which is A1,A2,A3 that mentioned above ) :

Thankyou

Topic advanced-custom-fields custom-field posts Wordpress

Category Web


Since ACF Relationships doesn't set any relationship as a parent or child,you'd be better of just getting the title from your post.

You could simply get the ID of your A page: the_title( '43' ); and output it like this, or if the post is actually a parent, you could simply do the_title( wp_get_post_parent_id() ); on your child template.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.