Closed ghen-arvesu closed 7 months ago
Thank you for the issue report, the templates are helpful to see. If I understand correctly, each LearnDash course has an ACF Post field called course_product
.
To help narrow down the cause, can you try the following simplified templates and tell me the resulting output? We can see where it stops working.
1. Get course product: Loop without orderby
or separate template
<Loop type=learndash_course enrolled=true count=1>
Course: <Field id /><br>
<Loop acf_post=course_product>
Course Product: <Field id /> - Excerpt: <Field excerpt />
</Loop>
</Loop>
If this doesn't work, the issue is related to the ACF Post field, how it's not able to find the associated course product.
2. Get course product: Loop without separate template
<Loop type=learndash_course enrolled=true orderby=date order=asc count=1>
Course: <Field id /><br>
<Loop acf_post=course_product>
Course Product: <Field id /> - Excerpt: <Field excerpt />
</Loop>
</Loop>
If this doesn't work, the issue is related to the LearnDash Course loop type and how it processes orderby
.
3. Get course product: Loop with separate template
<Loop type=learndash_course enrolled=true orderby=date order=asc count=1>
Course: <Field id /><br>
<Template name=course-product-test />
</Loop>
Template: course-product-test
<Loop acf_post=course_product>
Course Product: <Field id /> - Excerpt: <Field excerpt />
</Loop>
If this doesn't work, the issue is related to the Template
tag and how the loaded template is not able to get the ACF Post field from the current LearnDash course.
Hey @eliot-akira thanks so much for your response. We were able to solve this by noticing that:
Good to know! :smile:
Hi @eliot-akira , There seem to be a problem on the learndash course integration and the ACF post loop integration. Once we add the orderby=date order=asc then the excerpt and the other details are getting lost.
Here is how we used it.
Template: Course Item