170 lines
7.1 KiB
PHP
170 lines
7.1 KiB
PHP
<?php
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) exit;
|
|
|
|
$upstudy_ld_video = get_post_meta(get_the_ID(), 'upstudy_ld_video', 1);
|
|
|
|
echo '<div class="upstudy-course layout__' . esc_attr( $args['style'] ) . '">';
|
|
echo '<div class="course__container course_box_shadow">';
|
|
|
|
if ( $args['ld_archive_media_show'] ) {
|
|
echo '<div class="course__media course_overlay">';
|
|
|
|
if ( !empty( $upstudy_ld_video )) :
|
|
|
|
echo '<div class="intro-video-sidebar">';
|
|
echo '<div class="intro-video" style="background-image:url('. esc_url( $args['thumb_url'] ) .')">';
|
|
// echo '<a href="' . esc_url( $upstudy_ld_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( $args['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 ( $args['ld_cat_show'] && !empty( get_the_term_list(get_the_ID(), 'ld_course_category') )) {
|
|
echo '<div class="course__categories">';
|
|
echo get_the_term_list(get_the_ID(), 'ld_course_category');
|
|
echo '</div>';
|
|
}
|
|
if ( $args['ld_wishlist_show'] ) {
|
|
Upstudy_Wishlist::content( $post );
|
|
}
|
|
echo '</div>';
|
|
|
|
if ( $args['ld_instructor_img_on_off'] || $args['ld_instructor_name_on_off']):
|
|
|
|
echo '<div class="author__name">';
|
|
if ( $args['ld_instructor_img_on_off'] ) {
|
|
echo get_avatar( get_the_author_meta( 'ID' ), 32 );
|
|
}
|
|
if ( $args['ld_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 ( $args['ld_archive_title_show'] ) {
|
|
echo '<div class="get__title--info">';
|
|
echo upstudy_get_title();
|
|
echo '</div>';
|
|
}
|
|
|
|
if ( $args['ld_excerpt_show'] ) :
|
|
echo '<div class="course-excerpt course-excerpt-grid">';
|
|
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), esc_html( $args['excerpt_length'] ), esc_html( $args['excerpt_end'] ) ) );
|
|
echo '</div>';
|
|
endif;
|
|
|
|
$enrolled_base = upstudy_get_ld_course_meta( 'enrolled' );
|
|
$enrolled = upstudy_get_ld_course_student_count( get_the_ID(), $enrolled_base );
|
|
|
|
if ( $args['ld_enroll_show'] ) {
|
|
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( $enrolled );
|
|
if ( $args['ld_enroll_text_show']) {
|
|
_e( ' Enrolled', 'upstudy' );
|
|
}
|
|
echo '</span>';
|
|
|
|
echo '</div>';
|
|
}
|
|
|
|
if ( $args['ld_lesson_show'] ) {
|
|
echo '<div class="course-meta-inline">';
|
|
|
|
echo '<span class="upstudy-meta-border upstudy-course-lesson"><i class="dt-icon-learn"></i></span>';
|
|
|
|
echo '<span class="value">';
|
|
echo esc_attr($args['lessons']);
|
|
if ( $args['ld_lesson_text_show'] ) {
|
|
_e( ' Lessons', 'upstudy' );
|
|
}
|
|
echo '</span>';
|
|
|
|
echo '</div>';
|
|
}
|
|
|
|
if ( $args['ld_topic_show'] ) {
|
|
echo '<div class="course-meta-inline">';
|
|
|
|
echo '<span class="upstudy-meta-border upstudy-course-topic"><i class="dt-icon-book"></i></span>';
|
|
|
|
echo '<span class="value">';
|
|
echo esc_attr($args['topics']);
|
|
if ( $args['ld_topic_text_show'] ) {
|
|
_e( ' Topics', 'upstudy' );
|
|
}
|
|
echo '</span>';
|
|
|
|
echo '</div>';
|
|
}
|
|
|
|
$quiz = learndash_course_get_steps_by_type( get_the_ID(), 'sfwd-quiz' );
|
|
$quiz_count = $quiz ? count($quiz) : 0;
|
|
|
|
if ( $args['ld_quiz_show'] && !empty($quiz_count ) ) {
|
|
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_html( $quiz_count );
|
|
if ( $args['ld_quiz_text_show'] ) {
|
|
_e( ' quiz', 'upstudy' );
|
|
}
|
|
echo '</span>';
|
|
|
|
echo '</div>';
|
|
}
|
|
|
|
|
|
echo '</div>'; // <div class="course__content--info">
|
|
|
|
echo '<div class="course__border"></div>';
|
|
|
|
echo '<div class="course__content--meta">';
|
|
|
|
if ( $args['ld_price_show'] ) {
|
|
echo '<div class="course__meta-left">';
|
|
echo '<div class="price__1">';
|
|
echo wp_kses_post( Upstudy_LD_Helper::course_price() );
|
|
echo '</div>';
|
|
echo '</div>';
|
|
}
|
|
|
|
if ( $args['ld_see_more_btn'] ) {
|
|
echo '<div class="course__meta-right">';
|
|
echo '<div class="view-more-btn">';
|
|
if (!empty($args['ld_see_more_btn_text'])) {
|
|
echo '<a href="' . esc_url( get_permalink() ) . '">'. $args['ld_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>'; |