152 lines
6.3 KiB
PHP
152 lines
6.3 KiB
PHP
<?php
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) exit;
|
|
|
|
$upstudy_lp_video = get_post_meta(get_the_ID(), 'upstudy_lp_video', 1);
|
|
|
|
echo '<div class="upstudy-course layout__' . esc_attr( $layout_data['style'] ) . '">';
|
|
echo '<div class="course__container">';
|
|
|
|
if ( $layout_data['show_media'] ) {
|
|
echo '<div class="course__media">';
|
|
|
|
if ( !empty( $upstudy_lp_video )) :
|
|
|
|
echo '<div class="intro-video-sidebar">';
|
|
echo '<div class="intro-video" style="background-image:url('. esc_url( $layout_data['thumb_url'] ) .')">';
|
|
echo '<a href="' . esc_url( $upstudy_lp_video ) . '" class="upstudy-popup-videos bla-2"></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( $layout_data['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">';
|
|
|
|
$level = learn_press_get_post_level( get_the_ID() );
|
|
|
|
if ( $layout_data['lp_level_show'] ) {
|
|
echo '<div class="course__levels multi__color">';
|
|
echo esc_html($level);
|
|
echo '</div>';
|
|
}
|
|
|
|
if ( $layout_data['show_wishlist'] ) {
|
|
upstudy_lp_wishlist_icon( get_the_ID() );
|
|
}
|
|
|
|
echo '</div>';
|
|
|
|
echo '</div>';
|
|
|
|
} // == End media
|
|
|
|
echo '<div class="course__content">';
|
|
echo '<div class="course__content--info">';
|
|
|
|
if ( $layout_data['show_title'] ) {
|
|
echo '<div class="get__title--info">';
|
|
echo upstudy_get_title();
|
|
echo '</div>';
|
|
}
|
|
|
|
if ( $layout_data['show_excerpt'] ) :
|
|
echo '<div class="course-excerpt">';
|
|
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $layout_data['excerpt_length'] ), esc_html( $layout_data['excerpt_end'] ) ) );
|
|
echo '</div>';
|
|
endif;
|
|
|
|
echo '<div class="course-meta-inline-wrap">';
|
|
|
|
if ( $layout_data['show_enrolled'] ) {
|
|
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($layout_data['enrolled']);
|
|
if ($layout_data['show_enrolled_text']) {
|
|
_e( ' Students', 'upstudy' );
|
|
}
|
|
echo '</span>';
|
|
|
|
echo '</div>';
|
|
}
|
|
|
|
if ( $layout_data['show_lessons'] ) {
|
|
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($layout_data['lessons']);
|
|
if ($layout_data['show_lessons_text']) {
|
|
_e( ' Lessons', 'upstudy' );
|
|
}
|
|
echo '</span>';
|
|
|
|
echo '</div>';
|
|
}
|
|
|
|
|
|
if ( $layout_data['lp_quiz_show'] ) {
|
|
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">';
|
|
$course = \LP_Global::course();
|
|
$lessons = $course->get_items('lp_quiz', false) ? count($course->get_items('lp_quiz', false)) : 0;
|
|
printf('%s', $lessons);
|
|
if ( $layout_data['show_quiz_text'] ) {
|
|
_e( ' quiz', 'upstudy' );
|
|
}
|
|
echo '</span>';
|
|
|
|
echo '</div>';
|
|
}
|
|
|
|
echo '</div>'; // End Meta
|
|
|
|
if ( class_exists( 'LP_Addon_Course_Review_Preload' ) && $layout_data['lp_review_show'] ) :
|
|
echo '<div class="upstudy-course-rate">';
|
|
upstudy_lp_course_ratings();
|
|
echo '</div>';
|
|
endif;
|
|
|
|
echo '</div>';
|
|
|
|
echo '<div class="course__border"></div>';
|
|
|
|
echo '<div class="course__content--meta">';
|
|
|
|
if ($layout_data['show_price']) {
|
|
echo '<div class="course__meta-left">';
|
|
echo '<div class="price__1">';
|
|
get_template_part( 'learnpress/tpl-part/price');
|
|
echo '</div>';
|
|
echo '</div>';
|
|
}
|
|
|
|
if ( $layout_data['show_button'] ) {
|
|
echo '<div class="course__meta-right">';
|
|
echo '<div class="view-more-btn">';
|
|
if (!empty($layout_data['button_text'])) {
|
|
echo '<a href="' . esc_url( get_permalink() ) . '">'. layout_data['$button_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>'; |