This commit is contained in:
2026-04-23 04:33:43 +03:30
commit edde2ea185
11109 changed files with 3335449 additions and 0 deletions
@@ -0,0 +1,42 @@
<?php
/**
* A single course loop
*
* @package Tutor\Templates
* @subpackage CourseLoopPart
* @author Themeum
* @link https://themeum.com
* @since 1.4.3
*/
defined('ABSPATH') || exit();
use \Upstudy\Filter;
// Ensure $get_options is set as an array if not already provided
$get_options = isset($get_options) ? $get_options : array();
// Retrieve the course archive style setting if $style is not already set
$style = isset($style) ? $style : Upstudy::setting('tutor_course_archive_style');
// Override $style if 'course_preset' is present in the URL query parameters
if (isset($_GET['course_preset'])) {
$style = Filter::grid_layout_keys();
}
// Set the default data array with the style
$default_data = array(
'style' => $style
);
// Merge the provided $get_options with the default data
$get_options = wp_parse_args($get_options, $default_data);
// Ensure $column is set to default values if not already provided
$column = isset($column) ? $column : apply_filters('upstudy_course_archive_grid_column', array('upstudy-col-lg-4 upstudy-col-md-6 upstudy-col-sm-12'));
// Load the template with the specified layout style
tutor_load_template('tpl-part.course.th-layouts', compact('get_options'));
?>
@@ -0,0 +1,16 @@
<?php
/**
* Template for displaying single course
*
* @package Tutor\Templates
* @author Themeum <support@themeum.com>
* @link https://themeum.com
* @since 1.0.0
*/
$tutor_single_page_layout = Upstudy::setting('tutor_single_page_layout');
if (in_array($tutor_single_page_layout, ['1', '2', '3', '4', '5'])) {
get_template_part('tutor/tpl-part/single/single-layout', $tutor_single_page_layout);
}
?>
@@ -0,0 +1,190 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__' . esc_attr( $get_options['style'] ) . '">';
echo '<div class="course__container">';
if ( $get_options['show_media'] ) {
echo '<div class="course__media course_overlay">';
if ( !empty( $tutor_intro_video_url ) && $get_options['show_intor_video'] ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
echo '<div class="course__meta-top">';
if ( $get_options['show_cat'] && !empty( get_the_term_list(get_the_ID(), 'course-category') )) {
echo '<div class="course__categories">';
echo get_the_term_list(get_the_ID(), 'course-category');
echo '</div>';
}
if ( $get_options['show_wishlist'] ) {
upstudy_tutor_wishlist_icon( get_the_ID() );
}
echo '</div>';
echo '</div>';
} // == End media
echo '<div class="course__content">';
echo '<div class="course__content--info">';
if ( $get_options['show_review'] ) :
echo '<div class="upstudy-course-rate">';
echo '<div class="course-rating">';
$course_rating = tutor_utils()->get_course_rating( get_the_ID() );
echo '<div class="upstudy-rating-wrap">';
echo '<span class="upstudy-ratings-stars">';
echo tutor_utils()->star_rating_generator_v2( $course_rating->rating_avg, null, false, '', 'lg' );
echo '</span>';
echo '<span class="upstudy-ratings-total">';
$total_text = ('1' == $course_rating) ? esc_html__(' Review', 'upstudy') : esc_html__(' Reviews', 'upstudy');
echo esc_attr(' (');
echo esc_html( apply_filters( 'tutor_course_rating_average', $course_rating->rating_avg ) );
echo esc_attr('/');
echo esc_html( $course_rating->rating_count > 0 ? $course_rating->rating_count : 0 );
// if ( $get_options['show_review_text'] ) {
// echo esc_html($total_text);
// }
echo esc_attr(')');
echo '</span>';
echo '</div>'; // End .upstudy-rating-wrap
echo '</div>';
echo '</div>';
endif;
if ( $get_options['show_title'] ) {
echo '<div class="get__title--info">';
echo upstudy_get_title();
echo '</div>';
}
if ( $get_options['show_excerpt'] ) :
echo '<div class="course-excerpt course-excerpt-grid">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
if ( $get_options['show_author_img'] || $get_options['show_author_name']):
echo '<div class="course__meta-left">';
echo '<div class="author__name ' . esc_attr( $get_options['style'] == '1' ? ' tpc_mt_15' : '') . '">';
if ( $get_options['show_author_img'] ) {
echo get_avatar( get_the_author_meta( 'ID' ), 32 );
}
if ( $get_options['show_author_name'] ) {
the_author();
}
echo '</div>';
echo '</div>';
endif;
echo '</div>';
if ( $get_options['show_enrolled'] || $get_options['show_lessons'] || $get_options['show_quiz'] || $get_options['show_price']) {
echo '<div class="course__border"></div>';
echo '<div class="course__content--meta">';
if ( $get_options['show_enrolled'] || $get_options['show_lessons'] || $get_options['show_quiz'] ) {
echo '<div class="course__meta-left">';
$students = tutor_utils()->count_enrolled_users_by_course();
$students = $students ? $students : 0; // Ensure $students is an integer
$students_text = ($students == 1) ? esc_html__(' Student', 'upstudy') : esc_html__(' Students', 'upstudy');
if ($get_options['show_enrolled'] && $students > 0) { // Check if there are students
echo '<span class="course-enroll"><i class="dt-icon-user"></i>';
echo '<span class="value">';
echo esc_attr($students);
if ($get_options['show_enrolled_text']) {
echo esc_html($students_text);
}
echo '</span>';
echo '</span>';
}
$lessons = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lessons = $lessons ? $lessons : 0; // Ensure $lessons is an integer
$lessons_text = ($lessons == 1) ? esc_html__(' Lesson', 'upstudy') : esc_html__(' Lessons', 'upstudy');
if ($get_options['show_lessons']) {
echo '<span class="course-lessons"><i class="dt-icon-book"></i>';
echo '<span class="value">';
echo esc_attr($lessons);
if ($get_options['show_lessons_text']) {
echo esc_html($lessons_text);
}
echo '</span>';
echo '</span>';
}
$quiz = tutor_utils()->get_quiz_count_by_course(get_the_ID());
$quiz = $quiz ? $quiz : 0; // Ensure $quiz is an integer
$quiz_text = ($quiz == 1) ? esc_html__(' Quiz', 'upstudy') : esc_html__(' Quizzes', 'upstudy');
if ($get_options['show_quiz'] && $quiz > 0) {
echo '<span class="course-enroll"><i class="dt-icon-lightbulb"></i>';
echo '<span class="value">';
echo esc_attr($quiz);
if ($get_options['show_quiz_text']) {
echo esc_html($quiz_text);
}
echo '</span>';
echo '</span>';
}
echo '</div>';
}
if ($get_options['show_price']) {
echo '<div class="course__meta-right">';
echo '<div class="price__1">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
echo '</div>';
}
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,184 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__' . esc_attr( $get_options['style'] ) . ' col__3">';
echo '<div class="course__container">';
if ( $get_options['show_media'] ) {
echo '<div class="course__media">';
if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
echo '<div class="course__meta-top">';
if ( $get_options['show_cat'] && !empty( get_the_term_list(get_the_ID(), 'course-category') )) {
echo '<div class="course__categories">';
echo get_the_term_list(get_the_ID(), 'course-category');
echo '</div>';
}
if ( $get_options['show_wishlist'] ) {
upstudy_tutor_wishlist_icon( get_the_ID() );
}
echo '</div>';
if ($get_options['show_price']) {
echo '<div class="price__2">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
}
echo '</div>';
} // == End media
echo '<div class="course__content">';
echo '<div class="course__content--info">';
if ( $get_options['show_title'] ) {
echo '<div class="get__title--info">';
echo upstudy_get_title();
echo '</div>';
}
if ( $get_options['show_excerpt'] ) :
echo '<div class="course-excerpt course-excerpt-grid">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
if ( $get_options['show_review'] ) :
echo '<div class="upstudy-course-rate">';
echo '<div class="course-rating">';
$course_rating = tutor_utils()->get_course_rating( get_the_ID() );
echo '<div class="upstudy-rating-wrap">';
echo '<span class="upstudy-ratings-stars">';
echo tutor_utils()->star_rating_generator_v2( $course_rating->rating_avg, null, false, '', 'lg' );
echo '</span>';
echo '<span class="upstudy-ratings-total">';
$total_text = ('1' == $course_rating) ? esc_html__(' Review', 'upstudy') : esc_html__(' Reviews', 'upstudy');
echo esc_attr(' (');
echo esc_html( apply_filters( 'tutor_course_rating_average', $course_rating->rating_avg ) );
echo esc_attr('/');
echo esc_html( $course_rating->rating_count > 0 ? $course_rating->rating_count : 0 );
if ($tutor_review_text_show) {
echo esc_html($total_text);
}
echo esc_attr(')');
echo '</span>';
echo '</div>'; // End .upstudy-rating-wrap
echo '</div>';
echo '</div>';
endif;
echo '</div>';
echo '<div class="course__border"></div>';
echo '<div class="course__content--meta">';
if ( $get_options['show_author_img'] || $get_options['show_author_name']):
echo '<div class="author__name">';
if ( $get_options['show_author_img'] ) {
echo get_avatar( get_the_author_meta( 'ID' ), 32 );
}
if ( $get_options['show_author_name'] ) {
the_author();
}
echo '</div>';;
endif;
if ( $tutor_enroll_show || $tutor_lesson_show ) {
echo '<div class="course__meta-left">';
$students = tutor_utils()->count_enrolled_users_by_course();
$students = $students ? $students : 0; // Ensure $students is an integer
$students_text = ($students == 1) ? esc_html__(' Student', 'upstudy') : esc_html__(' Students', 'upstudy');
if ($tutor_enroll_show && $students > 0) { // Check if there are students
echo '<span class="course-enroll"><i class="dt-icon-user"></i>';
echo '<span class="value">';
echo esc_attr($students);
if ($tutor_enroll_text_show) {
echo esc_html($students_text);
}
echo '</span>';
echo '</span>';
}
$lessons = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lessons = $lessons ? $lessons : 0; // Ensure $lessons is an integer
$lessons_text = ($lessons == 1) ? esc_html__(' Lesson', 'upstudy') : esc_html__(' Lessons', 'upstudy');
if ($tutor_lesson_show) {
echo '<span class="course-lessons"><i class="dt-icon-book"></i>';
echo '<span class="value">';
echo esc_attr($lessons);
if ($tutor_lesson_text_show) {
echo esc_html($lessons_text);
}
echo '</span>';
echo '</span>';
}
$quiz = tutor_utils()->get_quiz_count_by_course(get_the_ID());
$quiz = $quiz ? $quiz : 0; // Ensure $quiz is an integer
$quiz_text = ($quiz == 1) ? esc_html__(' Quiz', 'upstudy') : esc_html__(' Quizzes', 'upstudy');
if ($tutor_quiz_show && $quiz > 0) {
echo '<span class="course-enroll"><i class="dt-icon-lightbulb"></i>';
echo '<span class="value">';
echo esc_attr($quiz);
if ($tutor_quiz_text_show) {
echo esc_html($quiz_text);
}
echo '</span>';
echo '</span>';
}
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,191 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__' . esc_attr( $get_options['style'] ) . '">';
echo '<div class="course__container">';
if ( $get_options['show_media'] ) {
echo '<div class="course__media">';
if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
echo '<div class="course__meta-top">';
if ( $get_options['show_level'] ) {
echo '<div class="course__levels">';
echo get_tutor_course_level();
echo '</div>';
}
if ( $get_options['show_wishlist'] ) {
upstudy_tutor_wishlist_icon( get_the_ID() );
}
echo '</div>';
echo '</div>';
} // == End media
echo '<div class="course__content">';
echo '<div class="course__content--info">';
if ( $get_options['show_cat'] && !empty( get_the_term_list(get_the_ID(), 'course-category') )) {
echo '<div class="course__categories__2">';
echo get_the_term_list(get_the_ID(), 'course-category');
echo '</div>';
}
if ( $get_options['show_title'] ) {
echo '<div class="get__title--info">';
echo upstudy_get_title();
echo '</div>';
}
if ( $get_options['show_excerpt'] ) :
echo '<div class="course-excerpt">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
if ( $get_options['show_review'] ) :
echo '<div class="upstudy-course-rate">';
echo '<div class="course-rating">';
$course_rating = tutor_utils()->get_course_rating( get_the_ID() );
echo '<div class="upstudy-rating-wrap">';
echo '<span class="upstudy-ratings-stars">';
echo tutor_utils()->star_rating_generator_v2( $course_rating->rating_avg, null, false, '', 'lg' );
echo '</span>';
echo '<span class="upstudy-ratings-total">';
$total_text = ('1' == $course_rating) ? esc_html__(' Review', 'upstudy') : esc_html__(' Reviews', 'upstudy');
echo esc_attr(' (');
echo esc_html( apply_filters( 'tutor_course_rating_average', $course_rating->rating_avg ) );
echo esc_attr('/');
echo esc_html( $course_rating->rating_count > 0 ? $course_rating->rating_count : 0 );
if ($tutor_review_text_show) {
echo esc_html($total_text);
}
echo esc_attr(')');
echo '</span>';
echo '</div>'; // End .upstudy-rating-wrap
echo '</div>';
echo '</div>';
endif;
echo '</div>';
echo '<div class="course__content--meta">';
if ( $tutor_enroll_show || $tutor_lesson_show ) {
echo '<div class="course__meta-left">';
$students = tutor_utils()->count_enrolled_users_by_course();
$students = $students ? $students : 0; // Ensure $students is an integer
$students_text = ($students == 1) ? esc_html__(' Student', 'upstudy') : esc_html__(' Students', 'upstudy');
if ($tutor_enroll_show && $students > 0) { // Check if there are students
echo '<span class="course-enroll"><i class="dt-icon-user"></i>';
echo '<span class="value">';
echo esc_attr($students);
if ($tutor_enroll_text_show) {
echo esc_html($students_text);
}
echo '</span>';
echo '</span>';
}
$lessons = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lessons = $lessons ? $lessons : 0; // Ensure $lessons is an integer
$lessons_text = ($lessons == 1) ? esc_html__(' Lesson', 'upstudy') : esc_html__(' Lessons', 'upstudy');
if ($tutor_lesson_show) {
echo '<span class="course-lessons"><i class="dt-icon-book"></i>';
echo '<span class="value">';
echo esc_attr($lessons);
if ($tutor_lesson_text_show) {
echo esc_html($lessons_text);
}
echo '</span>';
echo '</span>';
}
$quiz = tutor_utils()->get_quiz_count_by_course(get_the_ID());
$quiz = $quiz ? $quiz : 0; // Ensure $quiz is an integer
$quiz_text = ($quiz == 1) ? esc_html__(' Quiz', 'upstudy') : esc_html__(' Quizzes', 'upstudy');
if ($tutor_quiz_show && $quiz > 0) {
echo '<span class="course-enroll"><i class="dt-icon-lightbulb"></i>';
echo '<span class="value">';
echo esc_attr($quiz);
if ($tutor_quiz_text_show) {
echo esc_html($quiz_text);
}
echo '</span>';
echo '</span>';
}
echo '</div>';
}
echo '</div>';
if ( $get_options['show_author_name']):
echo '<div class="author__name ' . esc_attr( $get_options['style'] == '1' ? ' tpc_mt_15' : '') . '">';
if ( $get_options['show_author_name'] ) {
echo '<span class="author--by">';
echo esc_html__('By : ', 'upstudy');
echo '</span>';
echo '<span class="author--name">';
the_author();
echo '</span>';
}
echo '</div>';
endif;
echo '</div>';
if ($get_options['show_price']) {
echo '<div class="price__0">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
}
echo '</div>';
echo '</div>';
@@ -0,0 +1,184 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__' . esc_attr( $get_options['style'] ) . '">';
echo '<div class="course__container">';
if ( $get_options['show_media'] ) {
echo '<div class="course__media">';
if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
echo '<div class="course__meta-top">';
if ($get_options['show_price']) {
echo '<div class="price__4">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
}
if ( $get_options['show_wishlist'] ) {
upstudy_tutor_wishlist_icon( get_the_ID() );
}
echo '</div>';
if ( $get_options['show_author_img'] ):
echo '<div class="author__name">';
if ( $get_options['show_author_img'] ) {
echo get_avatar( get_the_author_meta( 'ID' ), 50 );
}
echo '</div>';
endif;
echo '</div>';
} // == End media
echo '<div class="course__content">';
echo '<div class="course__content--info">';
if ( $get_options['show_title'] ) {
echo '<div class="get__title--info">';
echo upstudy_get_title();
echo '</div>';
}
if ( $get_options['show_excerpt'] ) :
echo '<div class="course-excerpt">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
if ( $get_options['show_review'] ) :
echo '<div class="upstudy-course-rate">';
echo '<div class="course-rating">';
$course_rating = tutor_utils()->get_course_rating( get_the_ID() );
echo '<div class="upstudy-rating-wrap">';
echo '<span class="upstudy-ratings-stars">';
echo tutor_utils()->star_rating_generator_v2( $course_rating->rating_avg, null, false, '', 'lg' );
echo '</span>';
echo '<span class="upstudy-ratings-total">';
$total_text = ('1' == $course_rating) ? esc_html__(' Review', 'upstudy') : esc_html__(' Reviews', 'upstudy');
echo esc_attr(' (');
echo esc_html( apply_filters( 'tutor_course_rating_average', $course_rating->rating_avg ) );
echo esc_attr('/');
echo esc_html( $course_rating->rating_count > 0 ? $course_rating->rating_count : 0 );
if ($tutor_review_text_show) {
echo esc_html($total_text);
}
echo esc_attr(')');
echo '</span>';
echo '</div>'; // End .upstudy-rating-wrap
echo '</div>';
echo '</div>';
endif;
echo '</div>';
echo '<div class="course__border"></div>';
echo '<div class="course__content--meta">';
if ( $tutor_enroll_show || $tutor_lesson_show ) {
echo '<div class="course__meta-left">';
$students = tutor_utils()->count_enrolled_users_by_course();
$students = $students ? $students : 0; // Ensure $students is an integer
$students_text = ($students == 1) ? esc_html__(' Student', 'upstudy') : esc_html__(' Students', 'upstudy');
if ($tutor_enroll_show && $students > 0) { // Check if there are students
echo '<span class="course-enroll"><i class="dt-icon-user"></i>';
echo '<span class="value">';
echo esc_attr($students);
if ($tutor_enroll_text_show) {
echo esc_html($students_text);
}
echo '</span>';
echo '</span>';
}
$lessons = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lessons = $lessons ? $lessons : 0; // Ensure $lessons is an integer
$lessons_text = ($lessons == 1) ? esc_html__(' Lesson', 'upstudy') : esc_html__(' Lessons', 'upstudy');
if ($tutor_lesson_show) {
echo '<span class="course-lessons"><i class="dt-icon-book"></i>';
echo '<span class="value">';
echo esc_attr($lessons);
if ($tutor_lesson_text_show) {
echo esc_html($lessons_text);
}
echo '</span>';
echo '</span>';
}
$quiz = tutor_utils()->get_quiz_count_by_course(get_the_ID());
$quiz = $quiz ? $quiz : 0; // Ensure $quiz is an integer
$quiz_text = ($quiz == 1) ? esc_html__(' Quiz', 'upstudy') : esc_html__(' Quizzes', 'upstudy');
if ($tutor_quiz_show && $quiz > 0) {
echo '<span class="course-enroll"><i class="dt-icon-lightbulb"></i>';
echo '<span class="value">';
echo esc_attr($quiz);
if ($tutor_quiz_text_show) {
echo esc_html($quiz_text);
}
echo '</span>';
echo '</span>';
}
echo '</div>';
}
if ( $get_options['tutor_see_more_btn'] ) {
echo '<div class="course__meta-right">';
echo '<div class="view-more-btn">';
if (!empty($get_options['tutor_see_more_btn_text'])) {
echo '<a href="' . esc_url( get_permalink() ) . '">'. $get_options['tutor_see_more_btn_text'] .'</a>';
} else {
echo '<a href="' . esc_url( get_permalink() ) . '">'. esc_html__('View Details', 'upstudy').'</a>';
}
echo '</div>';
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,115 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__5 review__show col__3">';
echo '<div class="course__container">';
echo '<div class="course__media">';
if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
if ( $get_options['show_cat'] && !empty( get_the_term_list(get_the_ID(), 'course-category') )) {
echo '<div class="course__categories">';
echo get_the_term_list(get_the_ID(), 'course-category');
echo '</div>';
}
if ($get_options['show_price']) {
echo '<div class="price__2">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
}
echo '<div class="course__content--meta layout__5">';
if ( $get_options['show_author_img'] || $get_options['show_author_name']):
echo '<div class="author__name ' . esc_attr( $get_options['style'] == '1' ? ' tpc_mt_15' : '') . '">';
if ( $get_options['show_author_img'] ) {
echo get_avatar( get_the_author_meta( 'ID' ), 32 );
}
if ( $get_options['show_author_name'] ) {
the_author();
}
echo '</div>';
endif;
if ( $get_options['show_review'] ) :
echo '<div class="upstudy-course-rate">';
echo '<div class="course-rating">';
$course_rating = tutor_utils()->get_course_rating( get_the_ID() );
echo '<div class="upstudy-rating-wrap">';
echo '<span class="upstudy-ratings-stars">';
echo tutor_utils()->star_rating_generator_v2( $course_rating->rating_avg, null, false, '', 'lg' );
echo '</span>';
echo '<span class="upstudy-ratings-total">';
$total_text = ('1' == $course_rating) ? esc_html__(' Review', 'upstudy') : esc_html__(' Reviews', 'upstudy');
echo esc_attr(' (');
echo esc_html( apply_filters( 'tutor_course_rating_average', $course_rating->rating_avg ) );
echo esc_attr('/');
echo esc_html( $course_rating->rating_count > 0 ? $course_rating->rating_count : 0 );
if ($tutor_review_text_show) {
echo esc_html($total_text);
}
echo esc_attr(')');
echo '</span>';
echo '</div>'; // End .upstudy-rating-wrap
echo '</div>';
echo '</div>';
endif;
echo '</div>';
echo '</div>';
echo '<div class="course__content">';
echo '<div class="course__content--info">';
if ( $get_options['show_title'] ) {
echo '<div class="get__title--info">';
echo upstudy_get_title();
echo '</div>';
}
if ( $get_options['show_excerpt'] ) :
echo '<div class="course-excerpt">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,137 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__' . esc_attr( $get_options['style'] ) . '">';
echo '<div class="course__container">';
if ( $get_options['show_media'] ) {
echo '<div class="course__media">';
echo '<a class="no-course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<div class="upstudy-triangle-up"></div>';
echo '<div class="upstudy-circle"></div>';
echo '<div class="upstudy-rectangle"></div>';
echo '<div class="upstudy-circle-border"></div>';
echo '</a>';
echo '<div class="course__meta-top">';
if ( $get_options['show_wishlist'] ) {
upstudy_tutor_wishlist_icon( get_the_ID() );
}
echo '</div>';
if ( $get_options['show_title'] ) {
echo '<div class="top--title">';
echo upstudy_get_title();
echo '</div>';
}
echo '</div>';
} // == End media
echo '<div class="course__content">';
echo '<div class="course__content--info">';
if ( $get_options['show_review'] ) :
echo '<div class="upstudy-course-rate">';
echo '<div class="course-rating">';
$course_rating = tutor_utils()->get_course_rating( get_the_ID() );
echo '<div class="upstudy-rating-wrap">';
echo '<span class="upstudy-ratings-stars">';
echo tutor_utils()->star_rating_generator_v2( $course_rating->rating_avg, null, false, '', 'lg' );
echo '</span>';
echo '<span class="upstudy-ratings-total">';
$total_text = ('1' == $course_rating) ? esc_html__(' Review', 'upstudy') : esc_html__(' Reviews', 'upstudy');
echo esc_attr(' (');
echo esc_html( apply_filters( 'tutor_course_rating_average', $course_rating->rating_avg ) );
echo esc_attr('/');
echo esc_html( $course_rating->rating_count > 0 ? $course_rating->rating_count : 0 );
if ($tutor_review_text_show) {
echo esc_html($total_text);
}
echo esc_attr(')');
echo '</span>';
echo '</div>'; // End .upstudy-rating-wrap
echo '</div>';
echo '</div>';
endif;
if ( $get_options['show_excerpt'] ) :
echo '<div class="course-excerpt">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
if ( $get_options['show_author_img'] || $get_options['show_author_name']):
echo '<div class="author__name tpc_mt_15">';
if ( $get_options['show_author_img'] ) {
echo get_avatar( get_the_author_meta( 'ID' ), 32 );
}
if ( $get_options['show_author_name'] ) {
the_author();
}
echo '</div>';
endif;
echo '</div>';
echo '<div class="course__border"></div>';
echo '<div class="course__content--meta">';
if ( $get_options['show_price'] ) {
echo '<div class="course__meta-left">';
if ($get_options['show_price']) {
echo '<div class="course__meta-right">';
echo '<div class="price__1">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
echo '</div>';
}
echo '</div>';
}
// if ( $get_options['tutor_see_more_btn'] ) {
// echo '<div class="course__meta-right">';
// echo '<div class="view-more-btn">';
// if ($get_options['tutor_see_more_btn']) {
// echo '<a href="' . esc_url( get_permalink() ) . '">'. $get_options['tutor_see_more_btn_text'] .'</a>';
// } else {
// echo '<a href="' . esc_url( get_permalink() ) . '">'. esc_html__('View Details', 'upstudy').'</a>';
// }
// echo '</div>';
// echo '</div>';
// }
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,139 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
global $post;
echo '<div class="upstudy-course layout-' . esc_attr( $get_options['style'] ) . '">';
echo '<div class="course__container">';
echo '<div class="course__media">';
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
echo '<div class="course__meta-top">';
if ( $get_options['show_cat_list'] && !empty( get_the_term_list(get_the_ID(), 'course-category') )) {
echo '<div class="course__categories">';
echo get_the_term_list(get_the_ID(), 'course-category');
echo '</div>';
}
if ( $get_options['show_wishlist_list'] ) {
Upstudy_Wishlist::content( $post );
}
echo '</div>';
echo '</div>';
echo '<div class="course__content">';
if ($get_options['show_price']) {
echo '<div class="price__1">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
}
if ( $get_options['show_title'] ) {
echo upstudy_get_title();
}
if ( $get_options['show_review_list'] ) :
echo '<div class="upstudy-course-rate">';
echo '<div class="course-rating">';
$course_rating = tutor_utils()->get_course_rating( get_the_ID() );
echo '<div class="upstudy-rating-wrap">';
echo '<span class="upstudy-ratings-stars">';
echo tutor_utils()->star_rating_generator_v2( $course_rating->rating_avg, null, false, '', 'lg' );
echo '</span>';
echo '<span class="upstudy-ratings-total">';
$total_text = ('1' == $course_rating) ? esc_html__(' Review', 'upstudy') : esc_html__(' Reviews', 'upstudy');
echo esc_attr(' (');
echo esc_html( apply_filters( 'tutor_course_rating_average', $course_rating->rating_avg ) );
echo esc_attr(' /');
echo esc_html( $course_rating->rating_count > 0 ? $course_rating->rating_count : 0 );
if ( $get_options['show_review_list_text'] ) {
echo esc_html($total_text);
}
echo esc_attr(')');
echo '</span>';
echo '</div>'; // End .upstudy-rating-wrap
echo '</div>';
echo '</div>';
endif;
if ( $get_options['show_excerpt_list'] ) :
echo '<div class="course-excerpt course-excerpt-list">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length_list'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
echo '<div class="course__content--meta">';
if ( $get_options['show_enrolled_list'] || $get_options['show_lessons_list'] || $get_options['show_quiz_list'] ) {
echo '<div class="course__meta-left">';
$students = tutor_utils()->count_enrolled_users_by_course();
$students = $students ? $students : 0; // Ensure $students is an integer
$students_text = ($students == 1) ? esc_html__(' Student', 'upstudy') : esc_html__(' Students', 'upstudy');
if ($get_options['show_enrolled_list'] && $students > 0) { // Check if there are students
echo '<span class="course-enroll"><i class="dt-icon-user"></i>';
echo '<span class="value">';
echo esc_attr($students);
if ($get_options['show_enrolled_text_list']) {
echo esc_html($students_text);
}
echo '</span>';
echo '</span>';
}
$lessons = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lessons = $lessons ? $lessons : 0; // Ensure $lessons is an integer
$lessons_text = ($lessons == 1) ? esc_html__(' Lesson', 'upstudy') : esc_html__(' Lessons', 'upstudy');
if ($get_options['show_lessons_list']) {
echo '<span class="course-lessons"><i class="dt-icon-book"></i>';
echo '<span class="value">';
echo esc_attr($lessons);
// if ($get_options['show_lessons_list_text']) {
echo esc_html($lessons_text);
// }
echo '</span>';
echo '</span>';
}
$quiz = tutor_utils()->get_quiz_count_by_course(get_the_ID());
$quiz = $quiz ? $quiz : 0; // Ensure $quiz is an integer
$quiz_text = ($quiz == 1) ? esc_html__(' Quiz', 'upstudy') : esc_html__(' Quiz', 'upstudy');
if ($get_options['show_quiz_list'] && $quiz > 0) {
echo '<span class="course-enroll"><i class="dt-icon-lightbulb"></i>';
echo '<span class="value">';
echo esc_attr($quiz);
// if ($get_options['show_quiz_list_text']) {
echo esc_html($quiz_text);
// }
echo '</span>';
echo '</span>';
}
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,232 @@
<?php
defined( 'ABSPATH' ) || exit();
use \Upstudy\Filter;
global $post, $authordata;
if ( ! isset( $get_options ) ) :
$get_options = array();
endif;
$thumb_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'medium_large' );
if ( isset( $thumb_src ) && ! empty( $thumb_src ) ) :
$thumb_url = $thumb_src[0];
else :
$thumb_url = get_template_directory_uri() . '/assets/images/no-image-found.png';
endif;
if ( ! isset( $style ) ) :
$style = Upstudy::setting( 'tutor_course_archive_style' );
endif;
$button_text = '';
if ( isset( $_GET['button_text'] ) ) :
$button_text = wp_unslash( $_GET['button_text'] );
endif;
if ( isset( $_GET['course_preset'] ) ) :
$style = Filter::grid_layout_keys();
endif;
$show_review = '';
if ( isset( $_GET['show_review'] ) ) :
$show_review = wp_unslash( $_GET['show_review'] );
endif;
// $show_media = '';
if ( isset( $_GET['show_media'] ) ) :
$show_media = wp_unslash( $_GET['show_media'] );
endif;
// $show_intor_video = '';
if ( isset( $_GET['show_intor_video'] ) ) :
$show_intor_video = wp_unslash( $_GET['show_intor_video'] );
endif;
if ( isset( $_GET['show_intor_video'] ) ) {
$show_intor_video = wp_unslash( $_GET['show_intor_video'] );
}
// $show_excerpt = '';
if ( isset( $_GET['show_excerpt'] ) ) :
$show_excerpt = wp_unslash( $_GET['show_excerpt'] );
endif;
// $excerpt_length = '';
if ( isset( $_GET['excerpt_length'] ) ) :
$excerpt_length = wp_unslash( $_GET['excerpt_length'] );
endif;
// $show_author_img = '';
if ( isset( $_GET['show_author_img'] ) ) :
$show_author_img = wp_unslash( $_GET['show_author_img'] );
endif;
// $show_author_name = '';
if ( isset( $_GET['show_author_name'] ) ) :
$show_author_name = wp_unslash( $_GET['show_author_name'] );
endif;
// $show_enrolled = '';
if ( isset( $_GET['show_enrolled'] ) ) :
$show_enrolled = wp_unslash( $_GET['show_enrolled'] );
endif;
// $show_enrolled_text = '';
if ( isset( $_GET['show_enrolled_text'] ) ) :
$show_enrolled_text = wp_unslash( $_GET['show_enrolled_text'] );
endif;
// $show_lessons = '';
if ( isset( $_GET['show_lessons'] ) ) :
$show_lessons = wp_unslash( $_GET['show_lessons'] );
endif;
// $show_lessons_text = '';
if ( isset( $_GET['show_lessons_text'] ) ) :
$show_lessons_text = wp_unslash( $_GET['show_lessons_text'] );
endif;
// $show_quiz = '';
if ( isset( $_GET['show_quiz'] ) ) :
$show_quiz = wp_unslash( $_GET['show_quiz'] );
endif;
// $show_quiz_text = '';
if ( isset( $_GET['show_quiz_text'] ) ) :
$show_quiz_text = wp_unslash( $_GET['show_quiz_text'] );
endif;
// $show_price = '';
if ( isset( $_GET['show_price'] ) ) :
$show_price = wp_unslash( $_GET['show_price'] );
endif;
// $show_cat = '';
if ( isset( $_GET['show_cat'] ) ) :
$show_cat = wp_unslash( $_GET['show_cat'] );
endif;
// $show_wishlist = '';
if ( isset( $_GET['show_wishlist'] ) ) :
$show_wishlist = wp_unslash( $_GET['show_wishlist'] );
endif;
// $show_cat_list = '';
if ( isset( $_GET['show_cat_list'] ) ) :
$show_cat_list = wp_unslash( $_GET['show_cat_list'] );
endif;
// $show_excerpt_list = '';
if ( isset( $_GET['show_excerpt_list'] ) ) :
$show_excerpt_list = wp_unslash( $_GET['show_excerpt_list'] );
endif;
// $excerpt_length_list = '';
if ( isset( $_GET['excerpt_length_list'] ) ) :
$excerpt_length_list = wp_unslash( $_GET['excerpt_length_list'] );
endif;
// $show_review_list = '';
if ( isset( $_GET['show_review_list'] ) ) :
$show_review_list = wp_unslash( $_GET['show_review_list'] );
endif;
// $show_review_list_text = '';
if ( isset( $_GET['show_review_list_text'] ) ) :
$show_review_list_text = wp_unslash( $_GET['show_review_list_text'] );
endif;
// $show_enrolled_list = '';
if ( isset( $_GET['show_enrolled_list'] ) ) :
$show_enrolled_list = wp_unslash( $_GET['show_enrolled_list'] );
endif;
// $show_enrolled_text_list = '';
if ( isset( $_GET['show_enrolled_text_list'] ) ) :
$show_enrolled_text_list = wp_unslash( $_GET['show_enrolled_text_list'] );
endif;
// $show_lessons_list = '';
if ( isset( $_GET['show_lessons_list'] ) ) :
$show_lessons_list = wp_unslash( $_GET['show_lessons_list'] );
endif;
// $show_lessons_list_text = '';
if ( isset( $_GET['show_lessons_list_text'] ) ) :
$show_lessons_list_text = wp_unslash( $_GET['show_lessons_list_text'] );
endif;
// $show_quiz_list = '';
if ( isset( $_GET['show_quiz_list'] ) ) :
$show_quiz_list = wp_unslash( $_GET['show_quiz_list'] );
endif;
// $show_quiz_list_text = '';
if ( isset( $_GET['show_quiz_list_text'] ) ) :
$show_quiz_list_text = wp_unslash( $_GET['show_quiz_list_text'] );
endif;
$course_rating = tutor_utils()->get_course_rating();
$ratings_average = $course_rating->rating_avg;
$total_ratings = $course_rating->rating_count;
$percent = ( ! $ratings_average ) ? 0 : min( 100, ( round( $ratings_average * 2 ) / 2 ) * 20 );
$features = get_post_meta( get_the_ID(), 'upstudy_course_top_features', true );
$class_type = get_post_meta( get_the_ID(), 'upstudy_tl_course_class_type', true );
$default_data = [
'show_media' => $show_media,
'show_intor_video' => $show_intor_video,
'show_review' => $show_review,
'show_excerpt' => $show_excerpt,
'show_author_img' => $show_author_img,
'show_author_name' => $show_author_name,
'show_enrolled' => $show_enrolled,
'show_enrolled_text' => $show_enrolled_text,
'show_lessons' => $show_lessons,
'show_lessons_text' => $show_lessons_text,
'show_quiz' => $show_quiz,
'show_quiz_text' => $show_quiz_text,
'show_cat' => $show_cat,
'show_wishlist' => $show_wishlist,
'show_price' => $show_price,
'show_title' => $show_title,
'thumb_url' => $thumb_url,
'style' => $style,
'instructors' => tutor_utils()->get_instructors_by_course(),
// 'lessons' => tutor_utils()->get_lesson_count_by_course( get_the_ID() ),
'duration' => get_tutor_course_duration_context(),
// 'disable_enrolled' => get_tutor_option( 'disable_course_total_enrolled' ),
// 'enrolled' => tutor_utils()->count_enrolled_users_by_course(),
'cat_item' => upstudy_category_by_id( get_the_ID(), 'course-category' ),
'review_status' => get_tutor_option( 'enable_course_review' ),
'ratings_average' => $ratings_average,
'total_ratings' => $total_ratings,
'percent' => $percent,
'level' => get_tutor_course_level(),
'author' => $post->post_author,
'author_name' => $authordata->display_name,
'author_url' => tutor_utils()->profile_url( $authordata->ID ),
'features' => $features,
'button_text' => $button_text,
'uniqid' => uniqid(),
'class_type' => $class_type,
'enable_excerpt' => true,
'excerpt_length' => $excerpt_length,
'excerpt_end' => '...',
'show_cat_list' => $show_cat_list,
'show_excerpt_list' => $show_excerpt_list,
'excerpt_length_list' => $excerpt_length_list,
'show_review_list' => $show_review_list,
'show_review_list_text' => $show_review_list_text,
'show_enrolled_list' => $show_enrolled_list,
'show_enrolled_text_list' => $show_enrolled_text_list,
'show_lessons_list' => $show_lessons_list,
'show_lessons_list_text' => $show_lessons_list_text,
'show_quiz_list' => $show_quiz_list,
'show_quiz_list_text' => $show_quiz_list_text,
];
$get_options = wp_parse_args( $get_options, $default_data );
tutor_load_template( 'tpl-part.course.el-layout-' . $get_options['style'], compact( 'get_options', 'features' ) );
@@ -0,0 +1,214 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$tutor_archive_media_show = Upstudy::setting( 'tutor_archive_media_show' );
$tutor_archive_title_show = Upstudy::setting( 'tutor_archive_title_show' );
$tutor_excerpt_show = Upstudy::setting( 'tutor_excerpt_show' );
$tutor_cat_show = Upstudy::setting( 'tutor_cat_show' );
$tutor_wishlist_show = Upstudy::setting( 'tutor_wishlist_show' );
$tutor_instructor_img_on_off = Upstudy::setting( 'tutor_instructor_img_on_off' );
$tutor_instructor_name_on_off = Upstudy::setting( 'tutor_instructor_name_on_off' );
$tutor_lesson_show = Upstudy::setting( 'tutor_lesson_show' );
$tutor_lesson_text_show = Upstudy::setting( 'tutor_lesson_text_show' );
$tutor_price_show = Upstudy::setting( 'tutor_price_show' );
$tutor_enroll_show = Upstudy::setting( 'tutor_enroll_show' );
$tutor_enroll_text_show = Upstudy::setting( 'tutor_enroll_text_show' );
$tutor_review_show = Upstudy::setting( 'tutor_review_show' );
$tutor_review_text_show = Upstudy::setting( 'tutor_review_text_show' );
$tutor_level_show = Upstudy::setting( 'tutor_level_show' );
$tutor_see_more_btn = Upstudy::setting( 'tutor_see_more_btn' );
$tutor_see_more_btn_text = Upstudy::setting( 'tutor_see_more_btn_text' );
$tutor_intro_video = Upstudy::setting( 'tutor_intro_video' );
$tutor_quiz_show = Upstudy::setting( 'tutor_quiz_show' );
$tutor_quiz_text_show = Upstudy::setting( 'tutor_quiz_text_show' );
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__' . esc_attr( $get_options['style'] ) . '">';
echo '<div class="course__container course_box_shadow">';
if ( $tutor_archive_media_show ) {
echo '<div class="course__media course_overlay">';
if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
echo '<div class="course__meta-top">';
if ( $tutor_cat_show && !empty( get_the_term_list(get_the_ID(), 'course-category') )) {
echo '<div class="course__categories">';
echo get_the_term_list(get_the_ID(), 'course-category');
echo '</div>';
}
if ( $tutor_wishlist_show ) {
upstudy_tutor_wishlist_icon( get_the_ID() );
}
echo '</div>';
if ( $tutor_instructor_img_on_off || $tutor_instructor_name_on_off):
echo '<div class="author__name">';
if ( $tutor_instructor_img_on_off ) {
echo get_avatar( get_the_author_meta( 'ID' ), 32 );
}
if ( $tutor_instructor_name_on_off ) {
the_author();
}
echo '</div>';
endif;
echo '</div>';
} // == End media
echo '<div class="course__content">';
echo '<div class="course__content--info">';
if ( $tutor_archive_title_show ) {
echo '<div class="get__title--info">';
echo upstudy_get_title();
echo '</div>';
}
if ( $tutor_excerpt_show ) :
echo '<div class="course-excerpt course-excerpt-grid">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
$students = tutor_utils()->count_enrolled_users_by_course();
$students = $students ? $students : 0; // Ensure $students is an integer
$students_text = ($students == 1) ? esc_html__(' Student', 'upstudy') : esc_html__(' Students', 'upstudy');
if ($tutor_enroll_show && $students > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-enroll"><i class="dt-icon-user"></i></span>';
echo '<span class="value">';
echo esc_attr($students);
if ($tutor_enroll_text_show) {
echo esc_html($students_text);
}
echo '</span>';
echo '</div>';
}
$lessons = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lessons = $lessons ? $lessons : 0; // Ensure $lessons is an integer
$lessons_text = ($lessons == 1) ? esc_html__(' Lesson', 'upstudy') : esc_html__(' Lessons', 'upstudy');
if ($tutor_lesson_show && $lessons > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-lesson"><i class="dt-icon-book"></i></span>';
echo '<span class="value">';
echo esc_attr($lessons);
if ($tutor_lesson_text_show) {
echo esc_html($lessons_text);
}
echo '</span>';
echo '</div>';
}
$quiz = tutor_utils()->get_quiz_count_by_course(get_the_ID());
$quiz = $quiz ? $quiz : 0; // Ensure $quiz is an integer
$quiz_text = ($quiz == 1) ? esc_html__(' Quiz', 'upstudy') : esc_html__(' Quiz', 'upstudy');
if ($tutor_quiz_show && $quiz > 0) {
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-quiz"><i class="dt-icon-lightbulb"></i></span>';
echo '<span class="value">';
echo esc_attr($quiz);
if ($tutor_quiz_text_show) {
echo esc_html($quiz_text);
}
echo '</span>';
echo '</div>';
}
if ( $tutor_review_show ) {
$course_rating = tutor_utils()->get_course_rating( get_the_ID() );
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-review"><i class="dt-icon-favorite-1"></i></span>';
echo '<span class="upstudy-ratings-total">';
$total_text = ('1' == $course_rating) ? esc_html__(' Review', 'upstudy') : esc_html__(' Reviews', 'upstudy');
echo esc_attr(' (');
echo esc_html( apply_filters( 'tutor_course_rating_average', $course_rating->rating_avg ) );
echo esc_attr('/');
echo esc_html( $course_rating->rating_count > 0 ? $course_rating->rating_count : 0 );
if ($tutor_review_text_show) {
echo esc_html($total_text);
}
echo esc_attr(')');
echo '</span>';
echo '</div>'; // End .upstudy-rating-wrap
}
echo '</div>';
echo '<div class="course__border"></div>';
echo '<div class="course__content--meta">';
if ($tutor_price_show) {
echo '<div class="course__meta-left">';
echo '<div class="price__1">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
echo '</div>';
}
if ( $tutor_see_more_btn ) {
echo '<div class="course__meta-right">';
echo '<div class="view-more-btn">';
if (!empty($tutor_see_more_btn_text)) {
echo '<a href="' . esc_url( get_permalink() ) . '">'. $tutor_see_more_btn_text .'</a>';
} else {
echo '<a href="' . esc_url( get_permalink() ) . '">'. esc_html__('View Details', 'upstudy').'</a>';
}
echo '</div>';
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,115 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$tutor_archive_media_show = Upstudy::setting( 'tutor_archive_media_show' );
$tutor_archive_title_show = Upstudy::setting( 'tutor_archive_title_show' );
$tutor_excerpt_show = Upstudy::setting( 'tutor_excerpt_show' );
$tutor_cat_show = Upstudy::setting( 'tutor_cat_show' );
$tutor_wishlist_show = Upstudy::setting( 'tutor_wishlist_show' );
$tutor_instructor_img_on_off = Upstudy::setting( 'tutor_instructor_img_on_off' );
$tutor_instructor_name_on_off = Upstudy::setting( 'tutor_instructor_name_on_off' );
$tutor_lesson_show = Upstudy::setting( 'tutor_lesson_show' );
$tutor_lesson_text_show = Upstudy::setting( 'tutor_lesson_text_show' );
$tutor_price_show = Upstudy::setting( 'tutor_price_show' );
$tutor_enroll_show = Upstudy::setting( 'tutor_enroll_show' );
$tutor_enroll_text_show = Upstudy::setting( 'tutor_enroll_text_show' );
$tutor_review_show = Upstudy::setting( 'tutor_review_show' );
$tutor_review_text_show = Upstudy::setting( 'tutor_review_text_show' );
$tutor_level_show = Upstudy::setting( 'tutor_level_show' );
$tutor_see_more_btn = Upstudy::setting( 'tutor_see_more_btn' );
$tutor_see_more_btn_text = Upstudy::setting( 'tutor_see_more_btn_text' );
$tutor_intro_video = Upstudy::setting( 'tutor_intro_video' );
$tutor_quiz_show = Upstudy::setting( 'tutor_quiz_show' );
$tutor_quiz_text_show = Upstudy::setting( 'tutor_quiz_text_show' );
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__' . esc_attr( $get_options['style'] ) . ' col__3">';
echo '<div class="course__container">';
if ( $tutor_archive_media_show ) {
echo '<div class="course__media">';
if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
echo '<div class="course__meta-top">';
echo '</div>';
if ($tutor_price_show) {
echo '<div class="price__2">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
}
if ( $tutor_instructor_name_on_off){
echo '<div class="author__name"><i class="dt-icon-user"></i>';
if ( $tutor_instructor_name_on_off ) { the_author();}
echo '</div>';;
}
echo '</div>';
} // == End media
echo '<div class="course__content">';
echo '<div class="course__content--info">';
if ( $tutor_archive_title_show ) {
echo '<div class="get__title--info">';
echo upstudy_get_title();
echo '</div>';
}
if ( $tutor_excerpt_show ) :
echo '<div class="course-excerpt course-excerpt-grid">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
if ( $tutor_see_more_btn ) {
echo '<div class="course__meta-right">';
echo '<div class="view-more-btn">';
if (!empty($tutor_see_more_btn_text)) {
echo '<a href="' . esc_url( get_permalink() ) . '">'. $tutor_see_more_btn_text .'</a>';
} else {
echo '<a href="' . esc_url( get_permalink() ) . '">'. esc_html__('View Details', 'upstudy').'</a>';
}
echo '<i class="dt-icon-right-arrow"></i></div>';
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,138 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$tutor_archive_media_show = Upstudy::setting( 'tutor_archive_media_show' );
$tutor_archive_title_show = Upstudy::setting( 'tutor_archive_title_show' );
$tutor_excerpt_show = Upstudy::setting( 'tutor_excerpt_show' );
$tutor_cat_show = Upstudy::setting( 'tutor_cat_show' );
$tutor_wishlist_show = Upstudy::setting( 'tutor_wishlist_show' );
$tutor_instructor_img_on_off = Upstudy::setting( 'tutor_instructor_img_on_off' );
$tutor_instructor_name_on_off = Upstudy::setting( 'tutor_instructor_name_on_off' );
$tutor_lesson_show = Upstudy::setting( 'tutor_lesson_show' );
$tutor_lesson_text_show = Upstudy::setting( 'tutor_lesson_text_show' );
$tutor_price_show = Upstudy::setting( 'tutor_price_show' );
$tutor_enroll_show = Upstudy::setting( 'tutor_enroll_show' );
$tutor_enroll_text_show = Upstudy::setting( 'tutor_enroll_text_show' );
$tutor_review_show = Upstudy::setting( 'tutor_review_show' );
$tutor_review_text_show = Upstudy::setting( 'tutor_review_text_show' );
$tutor_level_show = Upstudy::setting( 'tutor_level_show' );
$tutor_see_more_btn = Upstudy::setting( 'tutor_see_more_btn' );
$tutor_see_more_btn_text = Upstudy::setting( 'tutor_see_more_btn_text' );
$tutor_intro_video = Upstudy::setting( 'tutor_intro_video' );
$tutor_quiz_show = Upstudy::setting( 'tutor_quiz_show' );
$tutor_quiz_text_show = Upstudy::setting( 'tutor_quiz_text_show' );
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__3 review__show col__3">';
echo '<div class="course__container">';
echo '<div class="course__media">';
if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
echo '<div class="course__meta-top">';
if ( $tutor_cat_show && !empty( get_the_term_list(get_the_ID(), 'course-category') )) {
echo '<div class="course__categories">';
echo get_the_term_list(get_the_ID(), 'course-category');
echo '</div>';
}
if ( $tutor_wishlist_show ) {
upstudy_tutor_wishlist_icon( get_the_ID() );
}
echo '</div>';
echo '</div>';
echo '<div class="course__content">';
echo '<div class="course__content--info">';
if ( $tutor_level_show ) {
echo '<div class="course__levels">';
echo get_tutor_course_level();
echo '</div>';
}
if ( $tutor_archive_title_show ) {
echo '<div class="get__title--info">';
echo upstudy_get_title();
echo '</div>';
}
if ( $tutor_excerpt_show ) :
echo '<div class="course-excerpt">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
if ( $tutor_review_show ) :
echo '<div class="upstudy-course-rate">';
echo '<div class="course-rating">';
$course_rating = tutor_utils()->get_course_rating( get_the_ID() );
echo '<div class="upstudy-rating-wrap">';
echo '<span class="upstudy-ratings-stars">';
echo tutor_utils()->star_rating_generator_v2( $course_rating->rating_avg, null, false, '', 'lg' );
echo '</span>';
echo '<span class="upstudy-ratings-total">';
echo '<span class="upstudy-course-separator">'. esc_attr('/') .'</span>';
echo esc_html( apply_filters( 'tutor_course_rating_average', $course_rating->rating_avg ) );
echo '</span>';
echo '</div>'; // End .upstudy-rating-wrap
echo '</div>';
echo '</div>';
endif;
if ($tutor_price_show) {
echo '<div class="price__1">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
}
if ( $tutor_see_more_btn ) {
echo '<div class="course__meta-right">';
echo '<div class="view-more-btn">';
if (!empty($tutor_see_more_btn_text)) {
echo '<a href="' . esc_url( get_permalink() ) . '">'. $tutor_see_more_btn_text .'</a>';
} else {
echo '<a href="' . esc_url( get_permalink() ) . '">'. esc_html__('Explore Now', 'upstudy').'</a>';
}
echo '</div>';
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,213 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$tutor_archive_media_show = Upstudy::setting( 'tutor_archive_media_show' );
$tutor_archive_title_show = Upstudy::setting( 'tutor_archive_title_show' );
$tutor_excerpt_show = Upstudy::setting( 'tutor_excerpt_show' );
$tutor_cat_show = Upstudy::setting( 'tutor_cat_show' );
$tutor_wishlist_show = Upstudy::setting( 'tutor_wishlist_show' );
$tutor_instructor_img_on_off = Upstudy::setting( 'tutor_instructor_img_on_off' );
$tutor_instructor_name_on_off = Upstudy::setting( 'tutor_instructor_name_on_off' );
$tutor_lesson_show = Upstudy::setting( 'tutor_lesson_show' );
$tutor_lesson_text_show = Upstudy::setting( 'tutor_lesson_text_show' );
$tutor_price_show = Upstudy::setting( 'tutor_price_show' );
$tutor_enroll_show = Upstudy::setting( 'tutor_enroll_show' );
$tutor_enroll_text_show = Upstudy::setting( 'tutor_enroll_text_show' );
$tutor_review_show = Upstudy::setting( 'tutor_review_show' );
$tutor_review_text_show = Upstudy::setting( 'tutor_review_text_show' );
$tutor_level_show = Upstudy::setting( 'tutor_level_show' );
$tutor_see_more_btn = Upstudy::setting( 'tutor_see_more_btn' );
$tutor_see_more_btn_text = Upstudy::setting( 'tutor_see_more_btn_text' );
$tutor_intro_video = Upstudy::setting( 'tutor_intro_video' );
$tutor_quiz_show = Upstudy::setting( 'tutor_quiz_show' );
$tutor_quiz_text_show = Upstudy::setting( 'tutor_quiz_text_show' );
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__' . esc_attr( $get_options['style'] ) . '">';
echo '<div class="course__container">';
if ( $tutor_archive_media_show ) {
echo '<div class="course__media">';
if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
echo '<div class="course__meta-top">';
if ( $tutor_level_show ) {
echo '<div class="course__levels multi__color">';
echo get_tutor_course_level();
echo '</div>';
}
if ( $tutor_wishlist_show ) {
upstudy_tutor_wishlist_icon( get_the_ID() );
}
echo '</div>';
echo '</div>';
} // == End media
echo '<div class="course__content">';
echo '<div class="course__content--info">';
if ( $tutor_archive_title_show ) {
echo '<div class="get__title--info">';
echo upstudy_get_title();
echo '</div>';
}
if ( $tutor_excerpt_show ) :
echo '<div class="course-excerpt">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
echo '<div class="course-meta-inline-wrap">';
$students = tutor_utils()->count_enrolled_users_by_course();
$students = $students ? $students : 0; // Ensure $students is an integer
$students_text = ($students == 1) ? esc_html__(' Student', 'upstudy') : esc_html__(' Students', 'upstudy');
if ($tutor_enroll_show && $students > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-enroll"><i class="dt-icon-user"></i></span>';
echo '<span class="value">';
echo esc_attr($students);
if ($tutor_enroll_text_show) {
echo esc_html($students_text);
}
echo '</span>';
echo '</div>';
}
$lessons = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lessons = $lessons ? $lessons : 0; // Ensure $lessons is an integer
$lessons_text = ($lessons == 1) ? esc_html__(' Lesson', 'upstudy') : esc_html__(' Lessons', 'upstudy');
if ($tutor_lesson_show && $lessons > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-lesson"><i class="dt-icon-book"></i></span>';
echo '<span class="value">';
echo esc_attr($lessons);
if ($tutor_lesson_text_show) {
echo esc_html($lessons_text);
}
echo '</span>';
echo '</div>';
}
$quiz = tutor_utils()->get_quiz_count_by_course(get_the_ID());
$quiz = $quiz ? $quiz : 0; // Ensure $quiz is an integer
$quiz_text = ($quiz == 1) ? esc_html__(' Quiz', 'upstudy') : esc_html__(' Quiz', 'upstudy');
if ($tutor_quiz_show && $quiz > 0) {
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-quiz"><i class="dt-icon-lightbulb"></i></span>';
echo '<span class="value">';
echo esc_attr($quiz);
if ($tutor_quiz_text_show) {
echo esc_html($quiz_text);
}
echo '</span>';
echo '</div>';
}
echo '</div>'; // End Meta
if ( $tutor_review_show ) :
echo '<div class="upstudy-course-rate">';
echo '<div class="course-rating">';
$course_rating = tutor_utils()->get_course_rating( get_the_ID() );
echo '<div class="upstudy-rating-wrap">';
echo '<span class="upstudy-ratings-stars">';
echo tutor_utils()->star_rating_generator_v2( $course_rating->rating_avg, null, false, '', 'lg' );
echo '</span>';
echo '<span class="upstudy-ratings-total">';
$total_text = ('1' == $course_rating) ? esc_html__(' Review', 'upstudy') : esc_html__(' Reviews', 'upstudy');
echo esc_attr(' (');
echo esc_html( apply_filters( 'tutor_course_rating_average', $course_rating->rating_avg ) );
echo esc_attr('/');
echo esc_html( $course_rating->rating_count > 0 ? $course_rating->rating_count : 0 );
if ($tutor_review_text_show) {
echo esc_html($total_text);
}
echo esc_attr(')');
echo '</span>';
echo '</div>'; // End .upstudy-rating-wrap
echo '</div>';
echo '</div>';
endif;
echo '</div>';
echo '<div class="course__border"></div>';
echo '<div class="course__content--meta">';
if ($tutor_price_show) {
echo '<div class="course__meta-left">';
echo '<div class="price__1">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
echo '</div>';
}
if ( $tutor_see_more_btn ) {
echo '<div class="course__meta-right">';
echo '<div class="view-more-btn">';
if (!empty($tutor_see_more_btn_text)) {
echo '<a href="' . esc_url( get_permalink() ) . '">'. $tutor_see_more_btn_text .'</a>';
} else {
echo '<a href="' . esc_url( get_permalink() ) . '">'. esc_html__('View Details', 'upstudy').'</a>';
}
echo '</div>';
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,152 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$tutor_archive_media_show = Upstudy::setting( 'tutor_archive_media_show' );
$tutor_archive_title_show = Upstudy::setting( 'tutor_archive_title_show' );
$tutor_excerpt_show = Upstudy::setting( 'tutor_excerpt_show' );
$tutor_cat_show = Upstudy::setting( 'tutor_cat_show' );
$tutor_wishlist_show = Upstudy::setting( 'tutor_wishlist_show' );
$tutor_instructor_img_on_off = Upstudy::setting( 'tutor_instructor_img_on_off' );
$tutor_instructor_name_on_off = Upstudy::setting( 'tutor_instructor_name_on_off' );
$tutor_lesson_show = Upstudy::setting( 'tutor_lesson_show' );
$tutor_lesson_text_show = Upstudy::setting( 'tutor_lesson_text_show' );
$tutor_price_show = Upstudy::setting( 'tutor_price_show' );
$tutor_enroll_show = Upstudy::setting( 'tutor_enroll_show' );
$tutor_enroll_text_show = Upstudy::setting( 'tutor_enroll_text_show' );
$tutor_review_show = Upstudy::setting( 'tutor_review_show' );
$tutor_review_text_show = Upstudy::setting( 'tutor_review_text_show' );
$tutor_level_show = Upstudy::setting( 'tutor_level_show' );
$tutor_see_more_btn = Upstudy::setting( 'tutor_see_more_btn' );
$tutor_see_more_btn_text = Upstudy::setting( 'tutor_see_more_btn_text' );
$tutor_intro_video = Upstudy::setting( 'tutor_intro_video' );
$tutor_quiz_show = Upstudy::setting( 'tutor_quiz_show' );
$tutor_quiz_text_show = Upstudy::setting( 'tutor_quiz_text_show' );
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__5 review__show col__3">';
echo '<div class="course__container">';
echo '<div class="course__media">';
if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
if ($tutor_price_show) {
echo '<div class="price__5">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
}
echo '</div>';
echo '<div class="course__content">';
echo '<div class="course__content--info">';
echo '<div class="course-meta-inline-wrap">';
$students = tutor_utils()->count_enrolled_users_by_course();
$students = $students ? $students : 0; // Ensure $students is an integer
$students_text = ($students == 1) ? esc_html__(' Student', 'upstudy') : esc_html__(' Students', 'upstudy');
if ($tutor_enroll_show && $students > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-enroll"><i class="dt-icon-user"></i></span>';
echo '<span class="value">';
echo esc_attr($students);
if ($tutor_enroll_text_show) {
echo esc_html($students_text);
}
echo '</span>';
echo '</div>';
}
$lessons = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lessons = $lessons ? $lessons : 0; // Ensure $lessons is an integer
$lessons_text = ($lessons == 1) ? esc_html__(' Lesson', 'upstudy') : esc_html__(' Lessons', 'upstudy');
if ($tutor_lesson_show && $lessons > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-lesson"><i class="dt-icon-book"></i></span>';
echo '<span class="value">';
echo esc_attr($lessons);
if ($tutor_lesson_text_show) {
echo esc_html($lessons_text);
}
echo '</span>';
echo '</div>';
}
$quiz = tutor_utils()->get_quiz_count_by_course(get_the_ID());
$quiz = $quiz ? $quiz : 0; // Ensure $quiz is an integer
$quiz_text = ($quiz == 1) ? esc_html__(' Quiz', 'upstudy') : esc_html__(' Quiz', 'upstudy');
if ($tutor_quiz_show && $quiz > 0) {
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-quiz"><i class="dt-icon-lightbulb"></i></span>';
echo '<span class="value">';
echo esc_attr($quiz);
if ($tutor_quiz_text_show) {
echo esc_html($quiz_text);
}
echo '</span>';
echo '</div>';
}
echo '</div>'; // End Meta
if ( $tutor_archive_title_show ) {
echo '<div class="get__title--info">';
echo upstudy_get_title();
echo '</div>';
}
if ( $tutor_see_more_btn ) {
echo '<div class="course__meta-right">';
echo '<div class="view-more-btn">';
if (!empty($tutor_see_more_btn_text)) {
echo '<a href="' . esc_url( get_permalink() ) . '">'. $tutor_see_more_btn_text .'</a>';
} else {
echo '<a href="' . esc_url( get_permalink() ) . '">'. esc_html__('View More', 'upstudy').'</a>';
}
echo '</div>';
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,164 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$tutor_archive_media_show = Upstudy::setting( 'tutor_archive_media_show' );
$tutor_archive_title_show = Upstudy::setting( 'tutor_archive_title_show' );
$tutor_excerpt_show = Upstudy::setting( 'tutor_excerpt_show' );
$tutor_cat_show = Upstudy::setting( 'tutor_cat_show' );
$tutor_wishlist_show = Upstudy::setting( 'tutor_wishlist_show' );
$tutor_instructor_img_on_off = Upstudy::setting( 'tutor_instructor_img_on_off' );
$tutor_instructor_name_on_off = Upstudy::setting( 'tutor_instructor_name_on_off' );
$tutor_lesson_show = Upstudy::setting( 'tutor_lesson_show' );
$tutor_lesson_text_show = Upstudy::setting( 'tutor_lesson_text_show' );
$tutor_price_show = Upstudy::setting( 'tutor_price_show' );
$tutor_enroll_show = Upstudy::setting( 'tutor_enroll_show' );
$tutor_enroll_text_show = Upstudy::setting( 'tutor_enroll_text_show' );
$tutor_review_show = Upstudy::setting( 'tutor_review_show' );
$tutor_review_text_show = Upstudy::setting( 'tutor_review_text_show' );
$tutor_level_show = Upstudy::setting( 'tutor_level_show' );
$tutor_see_more_btn = Upstudy::setting( 'tutor_see_more_btn' );
$tutor_see_more_btn_text = Upstudy::setting( 'tutor_see_more_btn_text' );
$tutor_intro_video = Upstudy::setting( 'tutor_intro_video' );
$tutor_quiz_show = Upstudy::setting( 'tutor_quiz_show' );
$tutor_quiz_text_show = Upstudy::setting( 'tutor_quiz_text_show' );
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__' . esc_attr( $get_options['style'] ) . '">';
echo '<div class="course__container">';
if ( $tutor_archive_media_show ) {
echo '<div class="course__media">';
echo '<a class="no-course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<div class="upstudy-triangle-up"></div>';
echo '<div class="upstudy-circle"></div>';
echo '<div class="upstudy-rectangle"></div>';
echo '<div class="upstudy-circle-border"></div>';
echo '</a>';
echo '<div class="course__meta-top">';
if ( $tutor_wishlist_show ) {
upstudy_tutor_wishlist_icon( get_the_ID() );
}
echo '</div>';
if ( $tutor_archive_title_show ) {
echo '<div class="top--title">';
echo upstudy_get_title();
echo '</div>';
}
// if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="intro-video upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
// endif;
echo '</div>';
} // == End media
echo '<div class="course__content">';
echo '<div class="course__content--info">';
if ($tutor_price_show) {
echo '<div class="price__1">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
}
if ($tutor_enroll_show || $tutor_enroll_show || $tutor_quiz_show || $tutor_excerpt_show) {
echo '<div class="course-meta-inline-wrap">';
$students = tutor_utils()->count_enrolled_users_by_course();
$students = $students ? $students : 0; // Ensure $students is an integer
$students_text = ($students == 1) ? esc_html__(' Student', 'upstudy') : esc_html__(' Students', 'upstudy');
if ($tutor_enroll_show && $students > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-enroll"><i class="dt-icon-user"></i></span>';
echo '<span class="value">';
echo esc_attr($students);
if ($tutor_enroll_text_show) {
echo esc_html($students_text);
}
echo '</span>';
echo '</div>';
}
$lessons = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lessons = $lessons ? $lessons : 0; // Ensure $lessons is an integer
$lessons_text = ($lessons == 1) ? esc_html__(' Lesson', 'upstudy') : esc_html__(' Lessons', 'upstudy');
if ($tutor_lesson_show && $lessons > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-lesson"><i class="dt-icon-book"></i></span>';
echo '<span class="value">';
echo esc_attr($lessons);
if ($tutor_lesson_text_show) {
echo esc_html($lessons_text);
}
echo '</span>';
echo '</div>';
}
$quiz = tutor_utils()->get_quiz_count_by_course(get_the_ID());
$quiz = $quiz ? $quiz : 0; // Ensure $quiz is an integer
$quiz_text = ($quiz == 1) ? esc_html__(' Quiz', 'upstudy') : esc_html__(' Quiz', 'upstudy');
if ($tutor_quiz_show && $quiz > 0) {
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-quiz"><i class="dt-icon-lightbulb"></i></span>';
echo '<span class="value">';
echo esc_attr($quiz);
if ($tutor_quiz_text_show) {
echo esc_html($quiz_text);
}
echo '</span>';
echo '</div>';
}
echo '</div>'; // End Meta
}
if ( $tutor_excerpt_show ) :
echo '<div class="course-excerpt">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
echo '</div>'; //
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,91 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$tutor_archive_media_show = Upstudy::setting( 'tutor_archive_media_show' );
$tutor_archive_title_show = Upstudy::setting( 'tutor_archive_title_show' );
$tutor_excerpt_show = Upstudy::setting( 'tutor_excerpt_show' );
$tutor_cat_show = Upstudy::setting( 'tutor_cat_show' );
$tutor_wishlist_show = Upstudy::setting( 'tutor_wishlist_show' );
$tutor_instructor_img_on_off = Upstudy::setting( 'tutor_instructor_img_on_off' );
$tutor_instructor_name_on_off = Upstudy::setting( 'tutor_instructor_name_on_off' );
$tutor_lesson_show = Upstudy::setting( 'tutor_lesson_show' );
$tutor_lesson_text_show = Upstudy::setting( 'tutor_lesson_text_show' );
$tutor_price_show = Upstudy::setting( 'tutor_price_show' );
$tutor_enroll_show = Upstudy::setting( 'tutor_enroll_show' );
$tutor_enroll_text_show = Upstudy::setting( 'tutor_enroll_text_show' );
$tutor_review_show = Upstudy::setting( 'tutor_review_show' );
$tutor_review_text_show = Upstudy::setting( 'tutor_review_text_show' );
$tutor_level_show = Upstudy::setting( 'tutor_level_show' );
$tutor_see_more_btn = Upstudy::setting( 'tutor_see_more_btn' );
$tutor_see_more_btn_text = Upstudy::setting( 'tutor_see_more_btn_text' );
$tutor_intro_video = Upstudy::setting( 'tutor_intro_video' );
$tutor_quiz_show = Upstudy::setting( 'tutor_quiz_show' );
$tutor_quiz_text_show = Upstudy::setting( 'tutor_quiz_text_show' );
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__7 review__show col__3">';
echo '<div class="course__container">';
echo '<div class="course__media">';
if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
if ($tutor_price_show) {
echo '<div class="price__4">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
}
if ( $tutor_level_show ) {
echo '<div class="levels_on__media course__levels">';
echo get_tutor_course_level();
echo '</div>';
}
echo '</div>';
echo '<div class="course__content">';
echo '<div class="course__content--info">';
if ( $tutor_archive_title_show ) {
echo '<div class="get__title--info">';
echo upstudy_get_title();
echo '</div>';
}
if ( $tutor_excerpt_show ) :
echo '<div class="course-excerpt">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,140 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$tutor_archive_media_show = Upstudy::setting( 'tutor_archive_media_show' );
$tutor_archive_title_show = Upstudy::setting( 'tutor_archive_title_show' );
$tutor_excerpt_show = Upstudy::setting( 'tutor_excerpt_show' );
$tutor_cat_show = Upstudy::setting( 'tutor_cat_show' );
$tutor_wishlist_show = Upstudy::setting( 'tutor_wishlist_show' );
$tutor_instructor_img_on_off = Upstudy::setting( 'tutor_instructor_img_on_off' );
$tutor_instructor_name_on_off = Upstudy::setting( 'tutor_instructor_name_on_off' );
$tutor_lesson_show = Upstudy::setting( 'tutor_lesson_show' );
$tutor_lesson_text_show = Upstudy::setting( 'tutor_lesson_text_show' );
$tutor_price_show = Upstudy::setting( 'tutor_price_show' );
$tutor_enroll_show = Upstudy::setting( 'tutor_enroll_show' );
$tutor_enroll_text_show = Upstudy::setting( 'tutor_enroll_text_show' );
$tutor_review_show = Upstudy::setting( 'tutor_review_show' );
$tutor_review_text_show = Upstudy::setting( 'tutor_review_text_show' );
$tutor_level_show = Upstudy::setting( 'tutor_level_show' );
$tutor_see_more_btn = Upstudy::setting( 'tutor_see_more_btn' );
$tutor_see_more_btn_text = Upstudy::setting( 'tutor_see_more_btn_text' );
$tutor_intro_video = Upstudy::setting( 'tutor_intro_video' );
$tutor_quiz_show = Upstudy::setting( 'tutor_quiz_show' );
$tutor_quiz_text_show = Upstudy::setting( 'tutor_quiz_text_show' );
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__8 review__show col__3">';
echo '<div class="course__container">';
echo '<div class="course_overlay course__media course__media_effect">';
if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
// if ( $tutor_level_show ) {
// echo '<div class="levels_on__media course__levels">';
// echo get_tutor_course_level();
// echo '</div>';
// }
if ( $tutor_archive_title_show ) {
echo '<div class="get__title--info">';
if ($tutor_price_show) {
echo '<div class="price__6">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
}
echo upstudy_get_title();
echo '</div>';
}
echo '<div class="course-meta-inline-wrap">';
$students = tutor_utils()->count_enrolled_users_by_course();
$students = $students ? $students : 0; // Ensure $students is an integer
$students_text = ($students == 1) ? esc_html__(' Student', 'upstudy') : esc_html__(' Students', 'upstudy');
if ($tutor_enroll_show && $students > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-enroll"><i class="dt-icon-user"></i></span>';
echo '<span class="value">';
echo esc_attr($students);
if ($tutor_enroll_text_show) {
echo esc_html($students_text);
}
echo '</span>';
echo '</div>';
}
$lessons = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lessons = $lessons ? $lessons : 0; // Ensure $lessons is an integer
$lessons_text = ($lessons == 1) ? esc_html__(' Lesson', 'upstudy') : esc_html__(' Lessons', 'upstudy');
if ($tutor_lesson_show && $lessons > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-lesson"><i class="dt-icon-book"></i></span>';
echo '<span class="value">';
echo esc_attr($lessons);
if ($tutor_lesson_text_show) {
echo esc_html($lessons_text);
}
echo '</span>';
echo '</div>';
}
$quiz = tutor_utils()->get_quiz_count_by_course(get_the_ID());
$quiz = $quiz ? $quiz : 0; // Ensure $quiz is an integer
$quiz_text = ($quiz == 1) ? esc_html__(' Quiz', 'upstudy') : esc_html__(' Quiz', 'upstudy');
if ($tutor_quiz_show && $quiz > 0) {
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-quiz"><i class="dt-icon-lightbulb"></i></span>';
echo '<span class="value">';
echo esc_attr($quiz);
if ($tutor_quiz_text_show) {
echo esc_html($quiz_text);
}
echo '</span>';
echo '</div>';
}
echo '</div>'; // End Meta
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,206 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$tutor_archive_media_show = Upstudy::setting( 'tutor_archive_media_show' );
$tutor_archive_title_show = Upstudy::setting( 'tutor_archive_title_show' );
$tutor_excerpt_show = Upstudy::setting( 'tutor_excerpt_show' );
$tutor_cat_show = Upstudy::setting( 'tutor_cat_show' );
$tutor_wishlist_show = Upstudy::setting( 'tutor_wishlist_show' );
$tutor_instructor_img_on_off = Upstudy::setting( 'tutor_instructor_img_on_off' );
$tutor_instructor_name_on_off = Upstudy::setting( 'tutor_instructor_name_on_off' );
$tutor_lesson_show = Upstudy::setting( 'tutor_lesson_show' );
$tutor_lesson_text_show = Upstudy::setting( 'tutor_lesson_text_show' );
$tutor_price_show = Upstudy::setting( 'tutor_price_show' );
$tutor_enroll_show = Upstudy::setting( 'tutor_enroll_show' );
$tutor_enroll_text_show = Upstudy::setting( 'tutor_enroll_text_show' );
$tutor_review_show = Upstudy::setting( 'tutor_review_show' );
$tutor_review_text_show = Upstudy::setting( 'tutor_review_text_show' );
$tutor_level_show = Upstudy::setting( 'tutor_level_show' );
$tutor_see_more_btn = Upstudy::setting( 'tutor_see_more_btn' );
$tutor_see_more_btn_text = Upstudy::setting( 'tutor_see_more_btn_text' );
$tutor_intro_video = Upstudy::setting( 'tutor_intro_video' );
$tutor_quiz_show = Upstudy::setting( 'tutor_quiz_show' );
$tutor_quiz_text_show = Upstudy::setting( 'tutor_quiz_text_show' );
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__9">';
echo '<div class="course__container course_box_shadow">';
if ( $tutor_archive_media_show ) {
echo '<div class="course__media">';
if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
echo '<div class="course__meta-top">';
if ( $tutor_level_show ) {
echo '<div class="course__levels multi__color">';
echo get_tutor_course_level();
echo '</div>';
}
if ( $tutor_wishlist_show ) {
upstudy_tutor_wishlist_icon( get_the_ID() );
}
echo '</div>';
echo '</div>';
} // == End media
echo '<div class="course__content">';
echo '<div class="course__content--info">';
if ( $tutor_archive_title_show ) {
echo '<div class="get__title--info">';
echo upstudy_get_title();
echo '</div>';
}
if ( $tutor_excerpt_show ) :
echo '<div class="course-excerpt">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
endif;
echo '<div class="course-meta-inline-wrap">';
$students = tutor_utils()->count_enrolled_users_by_course();
$students = $students ? $students : 0; // Ensure $students is an integer
$students_text = ($students == 1) ? esc_html__(' Student', 'upstudy') : esc_html__(' Students', 'upstudy');
if ($tutor_enroll_show && $students > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-enroll"><i class="dt-icon-user"></i></span>';
echo '<span class="value">';
echo esc_attr($students);
if ($tutor_enroll_text_show) {
echo esc_html($students_text);
}
echo '</span>';
echo '</div>';
}
$lessons = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lessons = $lessons ? $lessons : 0; // Ensure $lessons is an integer
$lessons_text = ($lessons == 1) ? esc_html__(' Lesson', 'upstudy') : esc_html__(' Lessons', 'upstudy');
if ($tutor_lesson_show && $lessons > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-lesson"><i class="dt-icon-book"></i></span>';
echo '<span class="value">';
echo esc_attr($lessons);
if ($tutor_lesson_text_show) {
echo esc_html($lessons_text);
}
echo '</span>';
echo '</div>';
}
$quiz = tutor_utils()->get_quiz_count_by_course(get_the_ID());
$quiz = $quiz ? $quiz : 0; // Ensure $quiz is an integer
$quiz_text = ($quiz == 1) ? esc_html__(' Quiz', 'upstudy') : esc_html__(' Quiz', 'upstudy');
if ($tutor_quiz_show && $quiz > 0) {
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-quiz"><i class="dt-icon-lightbulb"></i></span>';
echo '<span class="value">';
echo esc_attr($quiz);
if ($tutor_quiz_text_show) {
echo esc_html($quiz_text);
}
echo '</span>';
echo '</div>';
}
echo '</div>'; // End Meta
echo '</div>';
echo '<div class="course__border"></div>';
echo '<div class="course__content--meta">';
if ($tutor_price_show) {
echo '<div class="course__meta-left">';
echo '<div class="price__1">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
echo '</div>';
}
if ( $tutor_review_show ) {
echo '<div class="course__meta-right">';
if ( $tutor_review_show ) :
echo '<div class="upstudy-course-rate">';
echo '<div class="course-rating">';
$course_rating = tutor_utils()->get_course_rating( get_the_ID() );
echo '<div class="upstudy-rating-wrap">';
echo '<span class="upstudy-ratings-avg">';
echo esc_html( apply_filters( 'tutor_course_rating_average', $course_rating->rating_avg ) );
echo '</span>';
echo '<span class="upstudy-ratings-total">';
$total_text = ('1' == $course_rating) ? esc_html__(' Review', 'upstudy') : esc_html__(' Reviews', 'upstudy');
echo esc_attr(' (');
echo esc_html( $course_rating->rating_count > 0 ? $course_rating->rating_count : 0 );
if ($tutor_review_text_show) {
echo esc_html($total_text);
}
echo esc_attr(')');
echo '</span>';
echo '</div>'; // End .upstudy-rating-wrap
echo '</div>';
echo '</div>';
endif;
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,171 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
global $post;
$tutor_archive_media_show = Upstudy::setting( 'tutor_archive_media_show' );
$tutor_archive_title_show = Upstudy::setting( 'tutor_archive_title_show' );
$tutor_excerpt_show = Upstudy::setting( 'tutor_excerpt_show' );
$tutor_cat_show = Upstudy::setting( 'tutor_cat_show' );
$tutor_wishlist_show = Upstudy::setting( 'tutor_wishlist_show' );
$tutor_instructor_img_on_off = Upstudy::setting( 'tutor_instructor_img_on_off' );
$tutor_instructor_name_on_off = Upstudy::setting( 'tutor_instructor_name_on_off' );
$tutor_lesson_show = Upstudy::setting( 'tutor_lesson_show' );
$tutor_lesson_text_show = Upstudy::setting( 'tutor_lesson_text_show' );
$tutor_price_show = Upstudy::setting( 'tutor_price_show' );
$tutor_enroll_show = Upstudy::setting( 'tutor_enroll_show' );
$tutor_enroll_text_show = Upstudy::setting( 'tutor_enroll_text_show' );
$tutor_review_show = Upstudy::setting( 'tutor_review_show' );
$tutor_review_text_show = Upstudy::setting( 'tutor_review_text_show' );
$tutor_level_show = Upstudy::setting( 'tutor_level_show' );
$tutor_see_more_btn = Upstudy::setting( 'tutor_see_more_btn' );
$tutor_see_more_btn_text = Upstudy::setting( 'tutor_see_more_btn_text' );
$tutor_intro_video = Upstudy::setting( 'tutor_intro_video' );
$tutor_quiz_show = Upstudy::setting( 'tutor_quiz_show' );
$tutor_quiz_text_show = Upstudy::setting( 'tutor_quiz_text_show' );
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout-' . esc_attr( $get_options['style'] ) . '">';
echo '<div class="course__container">';
echo '<div class="course__media">';
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
echo '<div class="course__meta-top">';
if ( $tutor_cat_show && !empty( get_the_term_list(get_the_ID(), 'course-category') )) {
echo '<div class="course__categories">';
echo get_the_term_list(get_the_ID(), 'course-category');
echo '</div>';
}
if ( $tutor_wishlist_show ) {
Upstudy_Wishlist::content( $post );
}
echo '</div>';
echo '</div>';
echo '<div class="course__content">';
if ($tutor_price_show) {
echo '<div class="price__1">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
}
// if ( $get_options['show_title'] ) {
echo upstudy_get_title();
// }
if ( $tutor_review_show ) :
echo '<div class="upstudy-course-rate">';
echo '<div class="course-rating">';
$course_rating = tutor_utils()->get_course_rating( get_the_ID() );
echo '<div class="upstudy-rating-wrap">';
echo '<span class="upstudy-ratings-stars">';
echo tutor_utils()->star_rating_generator_v2( $course_rating->rating_avg, null, false, '', 'lg' );
echo '</span>';
echo '<span class="upstudy-ratings-total">';
$total_text = ('1' == $course_rating) ? esc_html__(' Review', 'upstudy') : esc_html__(' Reviews', 'upstudy');
echo esc_attr(' (');
echo esc_html( apply_filters( 'tutor_course_rating_average', $course_rating->rating_avg ) );
echo esc_attr(' /');
echo esc_html( $course_rating->rating_count > 0 ? $course_rating->rating_count : 0 );
// if ( $get_options['show_review_list_text'] ) {
echo esc_html($total_text);
// }
echo esc_attr(')');
echo '</span>';
echo '</div>'; // End .upstudy-rating-wrap
echo '</div>';
echo '</div>';
endif;
// if ( $get_options['show_excerpt_list'] ) :
echo '<div class="course-excerpt course-excerpt-list">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $get_options['excerpt_length'] ), esc_html( $get_options['excerpt_end'] ) ) );
echo '</div>';
// endif;
echo '<div class="course__content--meta">';
if ( $tutor_enroll_show || $tutor_lesson_show || $tutor_quiz_show ) {
echo '<div class="course__metß-left">';
$students = tutor_utils()->count_enrolled_users_by_course();
$students = $students ? $students : 0; // Ensure $students is an integer
$students_text = ($students == 1) ? esc_html__(' Student', 'upstudy') : esc_html__(' Students', 'upstudy');
if ( $students > 0) { // Check if there are students
echo '<span class="course-enroll"><i class="dt-icon-user"></i>';
echo '<span class="value">';
echo esc_attr($students);
if ($tutor_enroll_text_show) {
echo esc_html($students_text);
}
echo '</span>';
echo '</span>';
}
$lessons = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lessons = $lessons ? $lessons : 0; // Ensure $lessons is an integer
$lessons_text = ($lessons == 1) ? esc_html__(' Lesson', 'upstudy') : esc_html__(' Lessons', 'upstudy');
if ($tutor_lesson_show) {
echo '<span class="course-lessons"><i class="dt-icon-book"></i>';
echo '<span class="value">';
echo esc_attr($lessons);
if ($tutor_lesson_text_show) {
echo esc_html($lessons_text);
}
echo '</span>';
echo '</span>';
}
$quiz = tutor_utils()->get_quiz_count_by_course(get_the_ID());
$quiz = $quiz ? $quiz : 0; // Ensure $quiz is an integer
$quiz_text = ($quiz == 1) ? esc_html__(' Quiz', 'upstudy') : esc_html__(' Quiz', 'upstudy');
if ( $quiz > 0) {
echo '<span class="course-enroll"><i class="dt-icon-lightbulb"></i>';
echo '<span class="value">';
echo esc_attr($quiz);
if ($tutor_quiz_text_show) {
echo esc_html($quiz_text);
}
echo '</span>';
echo '</span>';
}
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
@@ -0,0 +1,78 @@
<?php
defined( 'ABSPATH' ) || exit();
use \Upstudy\Filter;
global $post, $authordata;
if ( ! isset( $get_options ) ) :
$get_options = array();
endif;
$tutor_archive_image_size = \Upstudy::setting( 'tutor_archive_image_size' );
$thumb_size = $tutor_archive_image_size ? $tutor_archive_image_size : 'upstudy-course-thumb';
if ( isset( $_GET['thumb_size'] ) ) :
$thumb_size = wp_unslash( $_GET['thumb_size'] );
endif;
$thumb_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), $thumb_size );
if ( isset( $thumb_src ) && ! empty( $thumb_src ) ) :
$thumb_url = $thumb_src[0];
else :
$thumb_url = get_template_directory_uri() . '/assets/images/no-image-found.png';
endif;
if ( ! isset( $style ) ) :
$style = Upstudy::setting( 'tutor_course_archive_style' );
endif;
$button_text = __( 'Enroll Now', 'upstudy' );
if ( isset( $_GET['button_text'] ) ) :
$button_text = wp_unslash( $_GET['button_text'] );
endif;
if ( isset( $_GET['course_preset'] ) ) :
$style = Filter::grid_layout_keys();
endif;
$course_rating = tutor_utils()->get_course_rating();
$ratings_average = $course_rating->rating_avg;
$total_ratings = $course_rating->rating_count;
$percent = ( ! $ratings_average ) ? 0 : min( 100, ( round( $ratings_average * 2 ) / 2 ) * 20 );
$features = get_post_meta( get_the_ID(), 'upstudy_course_top_features', true );
$class_type = get_post_meta( get_the_ID(), 'upstudy_tl_course_class_type', true );
$default_data = [
'thumb_url' => $thumb_url,
'style' => $style,
'instructors' => tutor_utils()->get_instructors_by_course(),
'lessons' => tutor_utils()->get_lesson_count_by_course( get_the_ID() ),
'quiz' => tutor_utils()->get_quiz_count_by_course( get_the_ID() ),
'duration' => get_tutor_course_duration_context(),
'disable_enrolled' => get_tutor_option( 'disable_course_total_enrolled' ),
'enrolled' => tutor_utils()->count_enrolled_users_by_course(),
'cat_item' => upstudy_category_by_id( get_the_ID(), 'course-category' ),
'review_status' => get_tutor_option( 'enable_course_review' ),
'ratings_average' => $ratings_average,
'total_ratings' => $total_ratings,
'percent' => $percent,
'level' => get_tutor_course_level(),
'author' => $post->post_author,
'author_name' => $authordata->display_name,
'author_url' => tutor_utils()->profile_url( $authordata->ID ),
'features' => $features,
'button_text' => $button_text,
'uniqid' => uniqid(),
'class_type' => $class_type,
'enable_excerpt' => true,
'excerpt_length' => 14,
'excerpt_end' => '...'
];
$get_options = wp_parse_args( $get_options, $default_data );
tutor_load_template( 'tpl-part.course.th-layout-' . $get_options['style'], compact( 'get_options', 'features' ) );
@@ -0,0 +1,15 @@
<div class="price">
<?php
//tutor_course_price();
$is_purchasable = tutor_utils()->is_course_purchasable();
$price = apply_filters( 'get_tutor_course_price', null, get_the_ID() );
if ( $is_purchasable && $price ) :
$price = $price;
else :
$price = __( 'Free', 'upstudy' );
endif;
echo wp_kses_post($price);
?></div>
@@ -0,0 +1,11 @@
<?php
$tutor_intro_video_position = Upstudy::setting( 'tutor_intro_video_position' );
if ( $tutor_intro_video_position == 'intro_video_content') :
tutor_utils()->has_video_in_single() ? tutor_course_video() : get_tutor_course_thumbnail();
endif;
@@ -0,0 +1,8 @@
<?php
echo '<div class="intro-video-sidebar intro-video-sidebar is__sidebar">';
echo '<div class="intro-video-content">';
tutor_utils()->has_video_in_single() ? tutor_course_video() : get_tutor_course_thumbnail();
echo '</div>';
echo '</div>'; // End intro-video-sidebar
@@ -0,0 +1,33 @@
<?php
$tutor_intro_video_position = Upstudy::setting( 'tutor_intro_video_position' );
$tutor_single_video_type = Upstudy::setting( 'tutor_single_video_type' );
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
if ( $tutor_intro_video_url && $tutor_single_video_type == 'video_by_theme_popup' && $tutor_intro_video_position == 'intro_video_sidebar' ) :
echo '<div class="intro-video-sidebar intro-video-content is__sidebar">';
echo '<div class="intro-video" style="background-image: url(' . esc_url( get_the_post_thumbnail_url(get_the_ID(),'upstudy-course-thumb') ) . ')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2">';
echo '<i class="dt-icon-play-button"></i>';
echo '</a>';
echo '</div>';
echo '</div>';
elseif ( $tutor_intro_video_position == 'intro_video_sidebar' ) :
// This block executes only if the first condition fails
echo '<div class="intro-video-sidebar intro-video-content is__sidebar">';
tutor_utils()->has_video_in_single() ? tutor_course_video() : get_tutor_course_thumbnail();
echo '</div>';
endif;
@@ -0,0 +1,25 @@
<?php
$tutor_custom_feature_group = get_post_meta(get_the_ID(), 'tutor_custom_feature_group', true);
if ($tutor_custom_feature_group) {
foreach ((array) $tutor_custom_feature_group as $key => $entry) {
$icon = !empty($entry['tutor_custom_feature_group_icon']) ? $entry['tutor_custom_feature_group_icon'] : 'dt-icon-play-button';
$label = !empty($entry['tutor_custom_feature_group_label']) ? $entry['tutor_custom_feature_group_label'] : '';
$value = !empty($entry['tutor_custom_feature_group_value']) ? $entry['tutor_custom_feature_group_value'] : '';
$unit = !empty($entry['tutor_custom_feature_group_unit']) ? $entry['tutor_custom_feature_group_unit'] : '';
// Icon classes
$if_has_dashicons = (strpos($icon, 'dashicons') !== false) ? 'dashicons' : '';
$if_has_fontawesome = (strpos($icon, 'fa-') !== false) ? 'fa' : '';
echo '<li>';
echo '<span class="label"><i class="meta-icon ' . esc_attr($if_has_fontawesome . ' ' . $if_has_dashicons . ' ' . $icon) . '"></i> ' . esc_html($label) . '</span>';
echo '<span class="value">';
echo '<span class="tutor-meta-level">' . esc_html($value) . '</span>';
if ($unit) {
echo '<span class="tutor-meta-value tutor-color-secondary tutor-mr-4">' . esc_html($unit) . '</span>';
}
echo '</span>';
echo '</li>';
}
}
@@ -0,0 +1,102 @@
<?php
use TUTOR\Input;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
global $post, $authordata, $course_rating;
$course_id = Input::post( 'course_id', get_the_ID(), Input::TYPE_INT );
$is_wish_listed = tutor_utils()->is_wishlisted( $post->ID, get_current_user_id() );
$tutor_single_page_layout = Upstudy::setting( 'tutor_single_page_layout' );
$tutor_instructor_single = Upstudy::setting( 'tutor_instructor_single' );
$tutor_single_last_update = Upstudy::setting( 'tutor_single_last_update' );
$tutor_lesson_single = Upstudy::setting( 'tutor_lesson_single' );
$tutor_single_enroll_btn = Upstudy::setting( 'tutor_single_enroll_btn' );
$tutor_duration_single = Upstudy::setting( 'tutor_duration_single' );
$tutor_single_wishlist = Upstudy::setting( 'tutor_single_wishlist' );
if ( !in_array( $tutor_single_page_layout, array('5')) ) {
echo '<div class="upstudy-course-single-header-meta-01">';
if ($tutor_instructor_single) {
echo '<div class="course-instructor post-author">';
echo '<span class="meta-value"><i class="meta-icon dt-icon-user"></i>';
the_author();
echo '</span>';
echo '</div>';
}
if ($tutor_single_wishlist) {
echo '<div class="tutor-col-auto">';
echo '<div class="tutor-course-details-actions tutor-mt-12 tutor-mt-sm-0">';
echo '<a href="#" class="tutor-btn tutor-btn-ghost tutor-course-wishlist-btn tutor-mr-16" data-course-id="' . get_the_ID() . '">';
echo '<i class="' . ($is_wish_listed ? 'tutor-icon-bookmark-bold' : 'tutor-icon-bookmark-line') . ' tutor-mr-8"></i>';
echo esc_html_e('Wishlist', 'upstudy');
echo '</a>';
echo '</div>';
echo '</div>';
}
// if (1==1) {
// echo '<div class="upstudy-last-update-wrap">';
// echo '<span class="upstudy-last-update">';
// echo esc_html__('Last Updated : ', 'upstudy');
// echo get_the_modified_date();
// echo '</span>';
// echo '</div>';
// }
echo '</div>';
}
if ( in_array( $tutor_single_page_layout, array('5')) ) {
echo '<div class="upstudy-course-single-header-meta-02">';
if ($tutor_lesson_single) {
$lesson = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lesson_text = ('1' == $lesson) ? esc_html__('Lesson', 'upstudy') : esc_html__('Lessons', 'upstudy');
echo '<div class="top__meta course-lesson">';
echo '<i class="meta-icon dt-icon-book"></i>';
echo '<span class="meta-value">';
echo esc_attr($lesson) . ' ' . esc_html($lesson_text);
echo '</span>';
echo '</div>';
}
$students = (int) tutor_utils()->count_enrolled_users_by_course();
if ( $students && $tutor_single_enroll_btn ):
echo '<div class="top__meta course-students">';
echo '<i class="meta-icon dt-icon-user"></i>';
echo '<span class="meta-value">';
echo esc_html($students);
echo esc_html__(' Enrolled', 'upstudy');
echo '</span>';
echo '</div>';
endif;
$course_duration = get_tutor_course_duration_context();
if ( $tutor_duration_single ):
echo '<div class="top__meta course-duration">';
echo '<i class="meta-icon dt-icon-start"></i>';
echo '<span class="meta-value">';
echo wp_kses_post($course_duration);
echo '</span>';
echo '</div>';
endif;
echo '</div>';
}
@@ -0,0 +1,71 @@
<?php
/**
* The template for displaying course single page
*/
$course_id = get_the_ID();
$course_rating = tutor_utils()->get_course_rating( $course_id );
$is_enrolled = tutor_utils()->is_enrolled( $course_id, get_current_user_id() );
// Prepare the nav items.
$course_nav_item = apply_filters( 'tutor_course/single/nav_items', tutor_utils()->course_nav_items(), $course_id );
$is_public = \TUTOR\Course_List::is_public( $course_id );
$is_mobile = wp_is_mobile();
$enrollment_box_position = tutor_utils()->get_option( 'enrollment_box_position_in_mobile', 'bottom' );
if ( '-1' === $enrollment_box_position ) {
$enrollment_box_position = 'bottom';
}
$student_must_login_to_view_course = tutor_utils()->get_option( 'student_must_login_to_view_course' );
tutor_utils()->tutor_custom_header();
if ( ! is_user_logged_in() && ! $is_public && $student_must_login_to_view_course ) {
tutor_load_template( 'login' );
tutor_utils()->tutor_custom_footer();
return;
}
$tutor_intro_video_position = Upstudy::setting( 'tutor_intro_video_position' );
$tutor_single_page_layout = Upstudy::setting( 'tutor_single_page_layout' );
echo '<article id="post-'; the_ID(); echo '"'; post_class( 'upstudy-course-single-wrap' ); echo '>';
if ( !in_array( $tutor_single_page_layout, array('5')) ) {
if ( $tutor_intro_video_position == 'intro_video_content' ) :
get_template_part( 'tutor/tpl-part/single/media', 'content' );
endif;
}
echo '<div class="post-wrapper">';
echo '<div class="tutor-course-details-tab">';
if (is_array($course_nav_item) && count($course_nav_item) > 1) :
echo '<div class="tutor-is-sticky">';
tutor_load_template('single.course.enrolled.nav', array('course_nav_item' => $course_nav_item));
echo '</div>';
endif;
echo '<div class="tutor-tab tutor-pt-24">';
foreach ($course_nav_item as $key => $subpage) :
echo '<div id="tutor-course-details-tab-' . esc_attr($key) . '" class="tutor-tab-item' . ('info' == $key ? ' is-active' : '') . '">';
do_action('tutor_course/single/tab/' . $key . '/before');
$method = $subpage['method'];
if (is_string($method)) {
$method();
} else {
$_object = $method[0];
$_method = $method[1];
$_object->$_method(get_the_ID());
}
do_action('tutor_course/single/tab/' . $key . '/after');
echo '</div>';
endforeach;
echo '</div>';
echo '</div>';
do_action('tutor_course/single/after/inner-wrap');
echo '</div>'; // End post-wrapper
echo ' </article>'; // End </article>
@@ -0,0 +1,50 @@
<?php
/**
* The template for displaying course single page
*/
get_header();
$tutor_course_header_style = Upstudy::setting( 'tutor_course_header_style' );
$tutor_related_course_position = Upstudy::setting( 'tutor_related_course_position' );
$tutor_intro_video_position = Upstudy::setting( 'tutor_intro_video_position' );
// ==== Content Area =====
echo '<div id="primary" class="content-area">';
echo '<main id="main" class="site-main" role="main">';
echo '<div class="upstudy-container">';
echo '<div class="upstudy-row">';
echo '<div class="upstudy-col-lg-8 order-2 order-lg-1 mt-4 mt-lg-0">';
while ( have_posts() ) : the_post();
// ==== Course Header =====
upstudy_course_page_title_section_00();
get_template_part( 'tutor/tpl-part/single/single', 'content' );
endwhile;
echo '</div>'; // End col-8
echo '<div class="upstudy-col-lg-4 order-1 order-lg-2">';
get_template_part( 'tutor/tpl-part/single/single', 'sidebar');
echo '</div>'; // End col-4
echo '</div>'; // End upstudy-row
if ( $tutor_related_course_position == 'content' ) {
echo '<div class="related-post-wrap related_course">';
upstudy_tutor_related_course_content();
echo '</div>';
}
echo '</div>';
echo '</main>';
echo '</div>';
get_footer();
@@ -0,0 +1,54 @@
<?php
/**
* The template for displaying course single page
*/
get_header();
$tutor_course_header_style = Upstudy::setting( 'tutor_course_header_style' );
$tutor_related_course_position = Upstudy::setting( 'tutor_related_course_position' );
// ==== Course Header =====
while ( have_posts() ) : the_post();
upstudy_tutor_course_page_title_section_05();
endwhile; wp_reset_postdata();
// ==== Content Area =====
echo '<div id="primary" class="content-area">';
echo '<main id="main" class="site-main" role="main">';
echo '<div class="upstudy-container">';
echo '<div class="upstudy-row upstudy-order-row">';
echo '<div class="upstudy-col-lg-8 upstudy-order-last">';
while ( have_posts() ) : the_post();
get_template_part( 'tutor/tpl-part/single/single', 'content' );
endwhile;
echo '</div>'; // End col-8
echo '<div class="upstudy-col-lg-4 upstudy-order-first">';
get_template_part( 'tutor/tpl-part/single/single', 'sidebar');
echo '</div>'; // End col-4
echo '</div>'; // End upstudy-row
if ( $tutor_related_course_position == 'content' ) {
echo '<div class="related-post-wrap related_course">';
upstudy_tutor_related_course_content();
echo '</div>';
}
echo '</div>';
echo '</main>';
echo '</div>';
get_footer();
@@ -0,0 +1,60 @@
<?php
/**
* The template for displaying course single page
*/
get_header();
$tutor_intro_video_position = Upstudy::setting( 'tutor_intro_video_position' );
$tutor_related_course_position = Upstudy::setting( 'tutor_related_course_position' );
$tutor_single_enroll_btn = Upstudy::setting( 'tutor_single_enroll_btn' );
$tutor_single_social_shear = Upstudy::setting( 'tutor_single_social_shear' );
$tutor_course_header_style = Upstudy::setting( 'tutor_course_header_style' );
// ==== Course Header =====
while ( have_posts() ) : the_post();
if ( '1' == $tutor_course_header_style ) {
upstudy_tutor_course_page_title_section_08();
}
else {
// upstudy_tutor_course_page_title_section_06();
}
endwhile; wp_reset_postdata();
// ==== Content Area =====
echo '<div id="primary" class="content-area">';
echo '<main id="main" class="site-main" role="main">';
echo '<div class="upstudy-container">';
while ( have_posts() ) : the_post();
echo '<div class="upstudy-course-content-03">';
echo '<div class="upstudy-course-intro-video">';
$tutor_intro_video_position = Upstudy::setting( 'tutor_intro_video_position' );
tutor_utils()->has_video_in_single() ? tutor_course_video() : get_tutor_course_thumbnail();
echo '</div>';
get_template_part( 'tutor/tpl-part/single/single', 'content' );
echo '</div>';
endwhile;
if ($tutor_related_course_position == 'content') {
echo '<div class="related-post-wrap related_course">';
upstudy_tutor_related_course_content();
echo '</div>';
}
echo '</div>';
echo '</main>';
echo '</div>';
get_footer();
@@ -0,0 +1,54 @@
<?php
/**
* The template for displaying course single page
*/
get_header();
$tutor_course_header_style = Upstudy::setting( 'tutor_course_header_style' );
$tutor_related_course_position = Upstudy::setting( 'tutor_related_course_position' );
// ==== Course Header =====
while ( have_posts() ) : the_post();
upstudy_tutor_course_page_title_section_04();
endwhile; wp_reset_postdata();
// ==== Content Area =====
echo '<div id="primary" class="content-area">';
echo '<main id="main" class="site-main" role="main">';
echo '<div class="upstudy-container">';
echo '<div class="upstudy-row">';
echo '<div class="upstudy-col-lg-8 order-2 order-lg-1 mt-4 mt-lg-0">';
while ( have_posts() ) : the_post();
get_template_part( 'tutor/tpl-part/single/single', 'content' );
endwhile;
echo '</div>'; // End col-8
echo '<div class="upstudy-col-lg-4 order-1 order-lg-2">';
get_template_part( 'tutor/tpl-part/single/single', 'sidebar');
echo '</div>'; // End col-4
echo '</div>'; // End upstudy-row
if ( $tutor_related_course_position == 'content' ) {
echo '<div class="related-post-wrap related_course">';
upstudy_tutor_related_course_content();
echo '</div>';
}
echo '</div>';
echo '</main>';
echo '</div>';
get_footer();
@@ -0,0 +1,62 @@
<?php
/**
* The template for displaying course single page
*/
get_header();
$tutor_course_header_style = Upstudy::setting( 'tutor_course_header_style' );
$tutor_related_course_position = Upstudy::setting( 'tutor_related_course_position' );
// ==== Course Header =====
while ( have_posts() ) : the_post();
upstudy_tutor_course_page_title_section_02();
endwhile; wp_reset_postdata();
// ==== Content Area =====
echo '<div id="primary" class="content-area">';
echo '<main id="main" class="site-main" role="main">';
echo '<div class="upstudy-container">';
echo '<div class="upstudy-row">';
echo '<div class="upstudy-col-lg-8 order-2 order-lg-1 mt-4 mt-lg-0">';
$tutor_intro_video_position = Upstudy::setting( 'tutor_intro_video_position' );
// if ( $tutor_intro_video_position == 'intro_video_content') :
tutor_utils()->has_video_in_single() ? tutor_course_video() : get_tutor_course_thumbnail();
// endif;
while ( have_posts() ) : the_post();
get_template_part( 'tutor/tpl-part/single/single', 'content' );
endwhile;
echo '</div>'; // End col-8
echo '<div class="upstudy-col-lg-4 order-1 order-lg-2">';
get_template_part( 'tutor/tpl-part/single/single', 'sidebar');
echo '</div>'; // End col-4
echo '</div>'; // End upstudy-row
if ( $tutor_related_course_position == 'content' ) {
echo '<div class="related-post-wrap related_course">';
upstudy_tutor_related_course_content();
echo '</div>';
}
echo '</div>';
echo '</main>';
echo '</div>';
get_footer();
@@ -0,0 +1,130 @@
<?php
$course_id = get_the_ID();
$course_rating = tutor_utils()->get_course_rating( $course_id );
$is_enrolled = tutor_utils()->is_enrolled( $course_id, get_current_user_id() );
// Prepare the nav items.
$course_nav_item = apply_filters( 'tutor_course/single/nav_items', tutor_utils()->course_nav_items(), $course_id );
$is_public = \TUTOR\Course_List::is_public( $course_id );
$is_mobile = wp_is_mobile();
$enrollment_box_position = tutor_utils()->get_option( 'enrollment_box_position_in_mobile', 'bottom' );
if ( '-1' === $enrollment_box_position ) {
$enrollment_box_position = 'bottom';
}
$student_must_login_to_view_course = tutor_utils()->get_option( 'student_must_login_to_view_course' );
tutor_utils()->tutor_custom_header();
if ( ! is_user_logged_in() && ! $is_public && $student_must_login_to_view_course ) {
tutor_load_template( 'login' );
tutor_utils()->tutor_custom_footer();
return;
}
$tutor_single_page_layout = Upstudy::setting( 'tutor_single_page_layout' );
$tutor_intro_video_position = Upstudy::setting( 'tutor_intro_video_position' );
$tutor_related_course_position = Upstudy::setting( 'tutor_related_course_position' );
$tutor_single_social_shear = Upstudy::setting( 'tutor_single_social_shear' );
$tutor_single_course_info = Upstudy::setting( 'tutor_single_course_info' );
$tutor_single_cat_list = Upstudy::setting( 'tutor_single_cat_list' );
$tutor_single_tags = Upstudy::setting( 'tutor_single_tags' );
$tutor_single_instructor = Upstudy::setting( 'tutor_single_instructor' );
$tutor_single_sidebar_sticky = Upstudy::setting( 'tutor_single_sidebar_sticky' );
$sidebar_sticky_on_off = ( $tutor_single_sidebar_sticky ? 'do_sticky' : '');
echo '<aside id="secondary" class="widget-area '; echo esc_attr( $sidebar_sticky_on_off ); echo '">';
echo '<div class="course-sidebar-preview tutor">';
// ==== Sidebar Course Includes ====
//if ($tutor_single_course_info) {
// if (function_exists('upstudy_tutor_course_info')) {
echo '<div class="tutor__widget">';
echo '<div class="tutor-sidebar-top-wrap">';
if ( !in_array( $tutor_single_page_layout, array('5')) ) {
if ( $tutor_intro_video_position == 'intro_video_sidebar' ) {
get_template_part( 'tutor/tpl-part/single/media', 'sidebar' );
}
}
do_action( 'tutor_course/single/before/sidebar' );
upstudy_tutor_course_info();
// ===== Sidebar share this course =====
if ($tutor_single_social_shear) {
echo '<div class="entry-post-share">';
echo '<div class="upstudy-social-share">';
echo '<div class="post-share style-04">';
echo '<div class="share-label">'; esc_html_e('Share This:', 'upstudy');echo '</div>';
echo '<div class="share-list">';
upstudy_get_sharing_list();
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
}
echo '</div>';
echo '<div class="tutor-single-course-sidebar-more tutor-mt-24">';
if ($tutor_single_instructor) {
tutor_course_instructors_html();
}
tutor_course_requirements_html();
if ( $tutor_single_tags ) {
tutor_course_tags_html();
}
tutor_course_target_audience_html();
echo '</div>';
do_action( 'tutor_course/single/after/sidebar' );
echo '</div>';
// }
//}
// ===== Sidebar course category =====
if ($tutor_single_cat_list && !empty(get_the_terms(get_the_ID(), 'tutor_course_category'))) {
if (function_exists('upstudy_tutor_course_category')) {
echo '<div class="tutor__widget">';
upstudy_tutor_course_category();
echo '</div>';
}
}
// ===== Sidebar widgets =====
if ($tutor_related_course_position == 'sidebar') {
if (function_exists('upstudy_tutor_related_course_sidebar')) {
echo '<div class="tutor__widget">';
upstudy_tutor_related_course_sidebar();
echo '</div>';
}
}
if (is_active_sidebar('tutor-course-sidebar-1')) :
echo '<div class="tutor__widget tpc-course-widget">';
dynamic_sidebar('tutor-course-sidebar-1');
echo '</div>';
endif;
echo '</div>';
echo '</aside>';
@@ -0,0 +1,14 @@
<?php
/**
* The template for displaying tutor single page
*/
get_header();
$post_id = upstudy_get_id();
$tutor_single_page_layout = Upstudy::setting('tutor_single_page_layout');
if (in_array($tutor_single_page_layout, ['1', '2', '3', '4', '5'])) {
get_template_part('tutor/tpl-part/single/single-layout', $tutor_single_page_layout);
}
get_footer();