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.
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.
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
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?
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:
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.
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.