Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I hope I can get some help, I've been trying to get this working for ages now.

Basically I have a theme which has 2 custom post types, courses and lessons. You can create a load lessons and add them to the course, it all works fine but when I tried to re-use the functionality it displays ALL the lessons instead of just the lessons that have been assigned.

Here's the code, maybe you can see what I'm doing wrong:

<?php if($lessons=ThemexCourse::sortLessons(ThemexCore::getRelatedItems($post->_lesson_course, 'lesson', 'course'))) { ?>
<div class="course-navigation">
<div class="course-title-sidebar"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
<?php ThemexCourse::initCourse($post->ID); ?>
> post_content), 0, 60); ?>
<ul class="course-list">
<?php foreach($lessons as $lesson) { ?>
<li class="<?php if($lesson->post_parent!=0) { ?>child<?php } ?> <?php if($post->ID==$lesson->ID) { ?>current<?php } ?>">

ID); ?>">ID); ?>

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.