Exemplo n.º 1
0
<?php

get_header();
?>

<section class="section-content">
	<div class="container clearfix">
		<div class="main-content">
			<?php 
while (have_posts()) {
    the_post();
    IB_Educator_View::template_part('content', 'single-course');
    get_template_part('lecturer-bio');
    echo educator_share();
    echo educator_related_courses(get_the_ID());
}
?>
		</div>

		<?php 
get_sidebar();
?>
	</div>
</section>

<?php 
get_footer();
Exemplo n.º 2
0
<?php

get_header();
the_post();
?>

<section class="section-content">
	<div class="container clearfix">
		<div class="main-content">
			<?php 
IB_Educator_View::template_part('content', 'single-lesson');
?>
		</div>

		<div class="page-sidebar">
			<?php 
$lesson_id = get_the_ID();
$api = IB_Educator::get_instance();
$lessons = $api->get_lessons(ib_edu_get_course_id($lesson_id));
if ($lessons->have_posts()) {
    $cl = null;
    if (class_exists('IB_Educator_Completed_Lessons')) {
        $cl = IB_Educator_Completed_Lessons::get_instance();
    }
    echo '<aside class="widget"><h1 class="widget-title">' . __('Lessons', 'ib-educator') . '</h1>';
    echo '<ul class="lessons-nav">';
    while ($lessons->have_posts()) {
        $lessons->the_post();
        $classes = null;
        if ($cl) {
            $classes = $cl->add_lesson_class(array(), get_the_ID());
Exemplo n.º 3
0
<?php

$query = new WP_Query(array('post_type' => 'ib_edu_membership', 'posts_per_page' => -1, 'post_status' => 'publish', 'order' => 'ASC', 'orderby' => 'menu_order'));
if ($query->have_posts()) {
    $tmp_more = $GLOBALS['more'];
    $GLOBALS['more'] = 0;
    ?>
	<div class="ib-edu-memberships">
	<?php 
    while ($query->have_posts()) {
        $query->the_post();
        IB_Educator_View::template_part('content', 'membership');
    }
    ?>
	</div>
	<?php 
    $GLOBALS['more'] = $tmp_more;
    wp_reset_postdata();
} else {
    echo '<p>' . __('No memberships found.', 'ibeducator') . '</p>';
}
Exemplo n.º 4
0
<?php

if ($courses->have_posts()) {
    ?>
	<?php 
    $columns = isset($atts['columns']) ? intval($atts['columns']) : 1;
    $classes = apply_filters('ib_educator_courses_list_classes', array('ib-edu-courses-list', 'ib-edu-courses-list-' . $columns));
    ?>

	<div class="<?php 
    echo esc_attr(implode(' ', $classes));
    ?>
">
	<?php 
    while ($courses->have_posts()) {
        $courses->the_post();
        if ($columns > 1) {
            IB_Educator_View::template_part('content', 'course');
        } else {
            IB_Educator_View::template_part('content', 'course-fw');
        }
    }
    ?>
	</div>

	<?php 
    wp_reset_postdata();
    if (!isset($atts['nopaging']) || 1 != $atts['nopaging']) {
        educator_paging_nav($courses->max_num_pages);
    }
}
Exemplo n.º 5
0
    /**
     * Display lessons of a given course.
     *
     * @param int $course_id
     */
    function edr_display_lessons($course_id)
    {
        $syllabus = get_post_meta($course_id, '_edr_syllabus', true);
        if (is_array($syllabus) && !empty($syllabus)) {
            $lesson_ids = array();
            $lessons = array();
            foreach ($syllabus as $group) {
                if (!empty($group['lessons'])) {
                    $lesson_ids = array_merge($lesson_ids, $group['lessons']);
                }
            }
            if (!empty($lesson_ids)) {
                $tmp = get_posts(array('post_type' => 'ib_educator_lesson', 'post__in' => $lesson_ids, 'post_status' => 'publish', 'posts_per_page' => count($lesson_ids)));
                foreach ($tmp as $lesson) {
                    $lessons[$lesson->ID] = $lesson;
                }
                unset($tmp);
            }
            IB_Educator_View::the_template('course/syllabus', array('syllabus' => $syllabus, 'lessons' => $lessons));
        } else {
            $query = IB_Educator::get_instance()->get_lessons($course_id);
            if ($query && $query->have_posts()) {
                ?>
			<section class="ib-edu-lessons">
				<h2><?php 
                _e('Lessons', 'ibeducator');
                ?>
</h2>
				<?php 
                while ($query->have_posts()) {
                    $query->the_post();
                    IB_Educator_View::template_part('content', 'lesson');
                }
                wp_reset_postdata();
                ?>
			</section>
		<?php 
            }
        }
    }
Exemplo n.º 6
0
>
	<h1 class="lesson-title entry-title"><?php 
the_title();
?>
</h1>

	<div id="ib-edu-breadcrumbs"><?php 
ib_edu_breadcrumbs();
?>
</div>

	<div class="lesson-content entry-content">
		<?php 
if ($student_can_study) {
    the_content();
    IB_Educator_View::template_part('quiz');
} else {
    echo '<p>';
    printf(__('Please register for the %s to view this lesson.', 'ibeducator'), '<a href="' . esc_url(get_permalink(ib_edu_get_course_id())) . '">' . __('course', 'ibeducator') . '</a>');
    echo '</p>';
}
?>
	</div>

	<nav class="ib-edu-lesson-nav">
		<?php 
echo ib_edu_get_adjacent_lesson_link('previous', '<div class="nav-previous">&laquo; %link</div>', __('Previous Lesson', 'ibeducator'));
echo ib_edu_get_adjacent_lesson_link('next', '<div class="nav-next">%link &raquo;</div>', __('Next Lesson', 'ibeducator'));
?>
	</nav>
</article>