Skip Navigation

[Resolved] Fetch data from related custom post (cont)

This support ticket is created 3 years, 6 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.

This topic contains 1 reply, has 1 voice.

Last updated by kelvinL-2 3 years, 6 months ago.

Author
Posts
#2136279
2126069-course_classes.jpeg

Dear Sir/Madam,

Refer to post https://toolset.com/forums/topic/fetch-data-from-related-custom-post/, I have no idea how to create a page to display a class that is associated with a specific course, please refer to the screenshot between the custom post.

I know how to design the content template for custom post type "Course", when I directly view the course, I could get the course post-id by using [wpv-post-id] but I should visit the class instead of course.

Can I create a page called "Course Portal" which will show the class detail bypassing class post-id as url-parameter and also show the related course detail by passing the course post-id? Should I need to create the content template for both class and course?

As my design has the external CSS and js file, how can I import the CSS and js into the content template? I want to keep both as separate files on the server so that I can easily maintain the code.

#2136565

I found the solution by using the relationship like
[wpv-view name="show-material" courseid="[wpv-post-id item="@course-class.parent"]"]