| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for displaying content of archive courses page. |
| 4 |
* |
| 5 |
* @author ThimPress |
| 6 |
* @package LearnPress/Templates |
| 7 |
* @version 4.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
defined( 'ABSPATH' ) || exit; |
| 11 |
|
| 12 |
/** |
| 13 |
* @since 4.0.0 |
| 14 |
* |
| 15 |
* @see LP_Template_General::template_header() |
| 16 |
*/ |
| 17 |
if ( empty( $is_block_theme ) ) { |
| 18 |
do_action( 'learn-press/template-header' ); |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* LP Hook |
| 23 |
*/ |
| 24 |
do_action( 'learn-press/before-main-content' ); |
| 25 |
|
| 26 |
$page_title = learn_press_page_title( false ); |
| 27 |
?> |
| 28 |
|
| 29 |
<div class="lp-content-area"> |
| 30 |
<?php if ( $page_title ) : ?> |
| 31 |
<header class="learn-press-courses-header"> |
| 32 |
<h1><?php echo wp_kses_post( $page_title ); ?></h1> |
| 33 |
|
| 34 |
<?php do_action( 'lp/template/archive-course/description' ); ?> |
| 35 |
</header> |
| 36 |
<?php endif; ?> |
| 37 |
|
| 38 |
<?php |
| 39 |
/** |
| 40 |
* LP Hook |
| 41 |
*/ |
| 42 |
do_action( 'learn-press/before-courses-loop' ); |
| 43 |
LP()->template( 'course' )->begin_courses_loop(); |
| 44 |
|
| 45 |
if ( LP_Settings_Courses::is_ajax_load_courses() && ! LP_Settings_Courses::is_no_load_ajax_first_courses() ) { |
| 46 |
echo '<div class="lp-archive-course-skeleton" style="width:100%">'; |
| 47 |
echo lp_skeleton_animation_html( 10, 'random', 'height:20px', 'width:100%' ); |
| 48 |
echo '</div>'; |
| 49 |
} else { |
| 50 |
if ( have_posts() ) { |
| 51 |
while ( have_posts() ) : |
| 52 |
the_post(); |
| 53 |
|
| 54 |
learn_press_get_template_part( 'content', 'course' ); |
| 55 |
|
| 56 |
endwhile; |
| 57 |
} else { |
| 58 |
LP()->template( 'course' )->no_courses_found(); |
| 59 |
} |
| 60 |
|
| 61 |
if ( LP_Settings_Courses::is_ajax_load_courses() ) { |
| 62 |
echo '<div class="lp-archive-course-skeleton no-first-load-ajax" style="width:100%; display: none">'; |
| 63 |
echo lp_skeleton_animation_html( 10, 'random', 'height:20px', 'width:100%' ); |
| 64 |
echo '</div>'; |
| 65 |
} |
| 66 |
} |
| 67 |
|
| 68 |
LP()->template( 'course' )->end_courses_loop(); |
| 69 |
do_action( 'learn-press/after-courses-loop' ); |
| 70 |
|
| 71 |
|
| 72 |
/** |
| 73 |
* LP Hook |
| 74 |
*/ |
| 75 |
do_action( 'learn-press/after-main-content' ); |
| 76 |
|
| 77 |
/** |
| 78 |
* LP Hook |
| 79 |
* |
| 80 |
* @since 4.0.0 |
| 81 |
*/ |
| 82 |
do_action( 'learn-press/sidebar' ); |
| 83 |
?> |
| 84 |
</div> |
| 85 |
|
| 86 |
<?php |
| 87 |
/** |
| 88 |
* @since 4.0.0 |
| 89 |
* |
| 90 |
* @see LP_Template_General::template_footer() |
| 91 |
*/ |
| 92 |
if ( empty( $is_block_theme ) ) { |
| 93 |
do_action( 'learn-press/template-footer' ); |
| 94 |
} |
| 95 |
|