Skip Navigation

[Resolved] How to pull any post field from CRED Form’s Parent

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display any post field from CRED Form's Parent

Solution:
To display custom field of parent you should use Types shortcode:

[types field="xxxx" id="$yyyy"][/types]

Where:
- xxxx is the field of the parent you want to show, and yyyy is the slug-name of the parent. The “$” is required, as this represents a variable where the parent post name will be replaced by the post ID, internally.

You can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/how-to-pull-any-post-field-from-cred-forms-parent/#post-726493

Relevant Documentation:
https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/

This support ticket is created 6 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

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 2 replies, has 2 voices.

Last updated by Minesh 6 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#719944

Tell us what you are trying to do? Pull more than the title, id or url of a parent post for a cred form

On all custom post pages on my site there is an 'inquire about this reservation' button (ex hidden link). When a user clicks it I would like to display a contact form (using CRED I guess) that shows (and passes in the notification) more information than just the title of the page. I would also like to display the date of the convention, name of the hotel, taxonomy of the parent post, etc. Are there easy shortcodes to include this information?

I have tried adapting the get title shortcode ([cred_post_parent get='title']) to [cred_post_parent get='hotel-name'] or [cred_post_parent field='hotel-name'] to no avail. I feel like I'm missing an easy way to show the desired parent post information.

Is there any documentation that you are following? This is the initial article: https://toolset.com/documentation/user-guides/cred-forms-for-child-content/
I was also directed here, but it is confusing and I don't think it's what I need: https://toolset.com/forums/topic/display-parent-fields-on-child-posts-front-end/

Is there a similar example that we can see? Not to my knowledge

What is the link to your site?
hidden link

#720023

And then furthermore how do I pass that information in the email notification of the post form submission? By using the same shortcodes? When I try to put '[cred_post_parent get='title']' in the notification email subject it gets sent as that string instead of what it should translate to.

#726493

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - using [cred_post_parent] shortcode you can display parent post ID, title and URL. As you can see here:
=> https://toolset.com/documentation/user-guides/cred-forms-for-child-content/#information-about-parent-items

To display custom field of parent you should use Types shortcode:

[types field="xxxx" id="$yyyy"][/types]

Where xxxx is the field of the parent you want to show, and yyyy is the slug-name of the parent. The “$” is required, as this represents a variable where the parent post name will be replaced by the post ID, internally.

More info:
https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/

Could you please try above method and try to resolve your issue.