Skip Navigation

[Resolved] Form to add testimonial for Advisor (custom post type)

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

Problem:

How to setup child post form?

Solution:

You can follow our document to setup the child post form

Relevant Documentation:

https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/

This support ticket is created 2 years, 11 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 8 replies, has 2 voices.

Last updated by WilliamM1564 2 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#2315329

Tell us what you are trying to do?
I am trying to create an Add Testimonial form to create a Testimonial for a specific advisor. I would like to display the form at the bottom of the Advisor template.

For the moment, I am trying to create the form correctly. I see I can add a field for the Advisor / Testimonial relationship, but I would rather have the testimonial attach automatically to the current advisor.

Is there any documentation that you are following?
No.

Is there a similar example that we can see?
I want the option to add a testimonial for an advisor from the Advisor's page (custom post type).

What is the link to your site?
hidden link

#2316053

Hello,

How do you setup the post type relationship between post types "Advisor" and "Testimonial"?
If it is one-to-many relationship, you can follow our document to setup the child post form:
https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/
section "Creating Forms with a Parent Post Preselected"

#2316797

It is one-to-many. That is one Advisor to many testimonials.

I see how this would work if I were not using Divi for the content template for Advisors, but I am using the Theme Builder in Divi.

How do I create a form like this and call it up in Divi?

#2316965

You can use Toolset shortcodes in Divi builders, for example, create a content template with classic editor, setup the child form link with toolset shortcode, copy/paste the toolset shortcode into Divi builder, it should be same workflow.

Since I don't have a Divi theme copy in my localhost, if you need more assistance for it, please provide a test site with the same problem, I can setup a demo for you.

#2317955

I can login into your website, will update here if find anything

#2317959

Yes, you are right, you need to put the child post form in a page.

I have setup a demo in your website:
1) Create a new page "Create child Testimonial post":
hidden link
Display the post form "Add Testimonial "

2) Edit the content template "Template for Advisors":
hidden link
Insert a Toolset Fields and Text block, and get the child form link shortcode:
<p>[cred_child_link_form form='597' text='Create new Testimonial' target='_self']</p>

You can use above shortcode into Divi builder to display the child form link, and use custom CSS codes to hide the parent select in "Add Testimonial" post form

#2318163

Oh! Now I get why we had to put the form in a page, because it actually comes up in another page. I thought we were embedding the form in the Advisor template.

Is there a way to embed the form in the actual Advisor page rather than having to go to another page?

#2318179
#2318209

My issue is resolved now. Thank you!