Skip Navigation

[Resolved] Content layout isn't displaying content from the parent post

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by Minesh 4 months, 2 weeks ago.

Assisted by: Minesh.

Author
Posts
#2672301
work-front-end.png
work-back-end.png

Hi there,

I have a portfolio of work on my website, hidden link. I have a custom post type for Clients and another for Works (projects for the client). There is a one-to-many relationship between them (there are multiple works for a single client).

On the Work content layout, I wish to display the page title and body (and some other fields) from the Work post, and I wish to display the body field from the parent Client post.

I've set up the layout to do this, and when I view the page in the block editor, all looks well. But when I view a Work on the public face of the site, the body field of the parent Client post does not display. In other words, I think I've configured the content template correctly because the backend displays the correct content, but things aren't working on the front-end. It may be a bug, but I'm not certain. I could provide an example, but sharing a WordPress dashboard URL won't be useful without credentials. This issue manifests itself with all Work posts.

Saul

#2672461

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share problem URL of your content template as well as on what single work post you want to display what parent post body content and share admin access details and let me check whats going wrong with your setup.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2672923

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

To your work content template - I've added the single field block and set this single field block to display the parent post content (body) field as you can see with the following screenshot: hidden link
- hidden link

Can you please confirm it works as expected.

#2673071
screenshot 2023-12-12 at 13.22.17.png

Thanks for your reply, Minesh.

Initially, the body field content appeared as desired. However, when I moved the field into a group (and where I want it to actually appear on the page), the field's content disappeared. (Note that both the Single Field block you created and the Paragraph block I created, each configured to display the body field in the parent Client post, are displaying nothing.) Please refer to the attached screenshot of the block editor.

Might the block editor Group have something to do with it?

Thanks.

Saul

#2673159

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

Instead of using the single field block or paragraph block I've added the "Fields and Text" block and within that I've added the following shortcode to display the parent:

[wpv-post-body view_template="None" item="@client-work-1-m-relationship.parent"]

Can you please confirm now that the parent post content is displayed as expected.

#2673251

Minesh,

This seems to have worked! Can you tell me why you had to resort to using a Fields and Text block? Under what circumstances would I need to do that? Why didn't using either the Paragraph block I created or the Single Field block you initially created work? Did I do something wrong? I feel convinced this is a bug.

Thanks again for your help.

Saul

#2673477

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Using "Field and Text" block I shared you workaround.

I will try to reproduce the issue with clean site and will try to add both single field block and paragraph block and will group it and check if it works, if I will be able to reproduce the issue successfully I will report it in front of our Devs and file internal ticket.

#2673497

Sounds good. Thank you again, Minesh! I appreciate your help.

Saul

saulB-3 confirmed that the issue was resolved on 2023-12-14 12:55:40.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.