course-filter
1 year ago
dashboard
1 year ago
email
2 years ago
global
3 years ago
instructor
3 years ago
loop
2 years ago
modal
3 years ago
profile
3 years ago
shortcode
2 years ago
single
2 years ago
template-part
3 years ago
widget
3 years ago
archive-course-init.php
1 year ago
archive-course.php
3 years ago
course-embed.php
3 years ago
course-none.php
3 years ago
dashboard.php
3 years ago
feature_disabled.php
3 years ago
login-form.php
3 years ago
login.php
3 years ago
metabox-wrapper.php
3 years ago
permission-denied.php
3 years ago
public-profile.php
2 years ago
single-assignment.php
3 years ago
single-content-loader.php
2 years ago
single-course.php
2 years ago
single-lesson.php
3 years ago
single-preview-lesson.php
3 years ago
single-quiz.php
3 years ago
template.php
3 years ago
single-course.php
107 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Template for displaying single course |
| 4 | * |
| 5 | * @package Tutor\Templates |
| 6 | * @author Themeum <support@themeum.com> |
| 7 | * @link https://themeum.com |
| 8 | * @since 1.0.0 |
| 9 | */ |
| 10 | |
| 11 | $course_id = get_the_ID(); |
| 12 | $course_rating = tutor_utils()->get_course_rating( $course_id ); |
| 13 | $is_enrolled = tutor_utils()->is_enrolled( $course_id, get_current_user_id() ); |
| 14 | |
| 15 | // Prepare the nav items. |
| 16 | $course_nav_item = apply_filters( 'tutor_course/single/nav_items', tutor_utils()->course_nav_items(), $course_id ); |
| 17 | $is_public = \TUTOR\Course_List::is_public( $course_id ); |
| 18 | $is_mobile = wp_is_mobile(); |
| 19 | |
| 20 | $enrollment_box_position = tutor_utils()->get_option( 'enrollment_box_position_in_mobile', 'bottom' ); |
| 21 | if ( '-1' === $enrollment_box_position ) { |
| 22 | $enrollment_box_position = 'bottom'; |
| 23 | } |
| 24 | $student_must_login_to_view_course = tutor_utils()->get_option( 'student_must_login_to_view_course' ); |
| 25 | |
| 26 | tutor_utils()->tutor_custom_header(); |
| 27 | |
| 28 | if ( ! is_user_logged_in() && ! $is_public && $student_must_login_to_view_course ) { |
| 29 | tutor_load_template( 'login' ); |
| 30 | tutor_utils()->tutor_custom_footer(); |
| 31 | return; |
| 32 | } |
| 33 | ?> |
| 34 | |
| 35 | <?php do_action( 'tutor_course/single/before/wrap' ); ?> |
| 36 | <div <?php tutor_post_class( 'tutor-full-width-course-top tutor-course-top-info tutor-page-wrap tutor-wrap-parent' ); ?>> |
| 37 | <div class="tutor-course-details-page tutor-container"> |
| 38 | <?php ( isset( $is_enrolled ) && $is_enrolled ) ? tutor_course_enrolled_lead_info() : tutor_course_lead_info(); ?> |
| 39 | <div class="tutor-row tutor-gx-xl-5"> |
| 40 | <main class="tutor-col-xl-8"> |
| 41 | <?php tutor_utils()->has_video_in_single() ? tutor_course_video() : get_tutor_course_thumbnail(); ?> |
| 42 | <?php do_action( 'tutor_course/single/before/inner-wrap' ); ?> |
| 43 | |
| 44 | <?php if ( $is_mobile && 'top' === $enrollment_box_position ) : ?> |
| 45 | <div class="tutor-mt-32"> |
| 46 | <?php tutor_load_template( 'single.course.course-entry-box' ); ?> |
| 47 | </div> |
| 48 | <?php endif; ?> |
| 49 | |
| 50 | <div class="tutor-course-details-tab tutor-mt-32"> |
| 51 | <?php if ( is_array( $course_nav_item ) && count( $course_nav_item ) > 1 ) : ?> |
| 52 | <div class="tutor-is-sticky"> |
| 53 | <?php tutor_load_template( 'single.course.enrolled.nav', array( 'course_nav_item' => $course_nav_item ) ); ?> |
| 54 | </div> |
| 55 | <?php endif; ?> |
| 56 | <div class="tutor-tab tutor-pt-24"> |
| 57 | <?php foreach ( $course_nav_item as $key => $subpage ) : ?> |
| 58 | <div id="tutor-course-details-tab-<?php echo esc_attr( $key ); ?>" class="tutor-tab-item<?php echo 'info' == $key ? ' is-active' : ''; ?>"> |
| 59 | <?php |
| 60 | do_action( 'tutor_course/single/tab/' . $key . '/before' ); |
| 61 | |
| 62 | $method = $subpage['method']; |
| 63 | if ( is_string( $method ) ) { |
| 64 | $method(); |
| 65 | } else { |
| 66 | $_object = $method[0]; |
| 67 | $_method = $method[1]; |
| 68 | $_object->$_method( get_the_ID() ); |
| 69 | } |
| 70 | |
| 71 | do_action( 'tutor_course/single/tab/' . $key . '/after' ); |
| 72 | ?> |
| 73 | </div> |
| 74 | <?php endforeach; ?> |
| 75 | </div> |
| 76 | </div> |
| 77 | <?php do_action( 'tutor_course/single/after/inner-wrap' ); ?> |
| 78 | </main> |
| 79 | |
| 80 | <aside class="tutor-col-xl-4"> |
| 81 | <?php $sidebar_attr = apply_filters( 'tutor_course_details_sidebar_attr', '' ); ?> |
| 82 | <div class="tutor-single-course-sidebar tutor-mt-40 tutor-mt-xl-0" <?php echo esc_attr( $sidebar_attr ); ?> > |
| 83 | <?php do_action( 'tutor_course/single/before/sidebar' ); ?> |
| 84 | |
| 85 | <?php if ( ( $is_mobile && 'bottom' === $enrollment_box_position ) || ! $is_mobile ) : ?> |
| 86 | <?php tutor_load_template( 'single.course.course-entry-box' ); ?> |
| 87 | <?php endif ?> |
| 88 | |
| 89 | <div class="tutor-single-course-sidebar-more tutor-mt-24"> |
| 90 | <?php tutor_course_instructors_html(); ?> |
| 91 | <?php tutor_course_requirements_html(); ?> |
| 92 | <?php tutor_course_tags_html(); ?> |
| 93 | <?php tutor_course_target_audience_html(); ?> |
| 94 | </div> |
| 95 | |
| 96 | <?php do_action( 'tutor_course/single/after/sidebar' ); ?> |
| 97 | </div> |
| 98 | </aside> |
| 99 | </div> |
| 100 | </div> |
| 101 | </div> |
| 102 | |
| 103 | <?php do_action( 'tutor_course/single/after/wrap' ); ?> |
| 104 | |
| 105 | <?php |
| 106 | tutor_utils()->tutor_custom_footer(); |
| 107 |