예제 #1
0
<div id="primary" class="content-area gdlr-lms-primary-wrapper">
<div id="content" class="site-content" role="main">
<?php 
if (function_exists('gdlr_lms_get_header') && !empty($gdlr_lms_option['show-header']) && $gdlr_lms_option['show-header'] == 'enable') {
    gdlr_lms_get_header();
}
?>
	<div class="gdlr-lms-content">
		<div class="gdlr-lms-container gdlr-lms-container">
			<div class="gdlr-lms-item" >
			<?php 
if ($gdlr_lms_option['archive-course-style'] == 'grid') {
    gdlr_lms_print_course_grid($wp_query, $gdlr_lms_option['archive-course-thumbnail-size'], $gdlr_lms_option['archive-course-size']);
} else {
    if ($gdlr_lms_option['archive-course-style'] == 'grid-2') {
        gdlr_lms_print_course_grid2($wp_query, $gdlr_lms_option['archive-course-thumbnail-size'], $gdlr_lms_option['archive-course-size']);
    } else {
        if ($gdlr_lms_option['archive-course-style'] == 'medium') {
            gdlr_lms_print_course_medium($wp_query, $gdlr_lms_option['archive-course-thumbnail-size']);
        } else {
            if ($gdlr_lms_option['archive-course-style'] == 'full') {
                gdlr_lms_print_course_full($wp_query, $gdlr_lms_option['archive-course-thumbnail-size']);
            }
        }
    }
}
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
echo gdlr_lms_get_pagination($wp_query->max_num_pages, $paged);
?>
			</div>
		</div><!-- gdlr-lms-container -->
예제 #2
0
function gdlr_lms_print_course_item($settings, $page_builder = false)
{
    if ($page_builder) {
        $item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
        global $gdlr_spaces;
        $margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
        $margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
        if (in_array($settings['course-style'], array('grid', 'grid-2')) && $settings['course-layout'] == 'carousel') {
            $settings['carousel'] = true;
        }
        echo gdlr_get_item_title($settings);
    } else {
        $item_id = '';
        $margin_style = "";
    }
    echo '<div class="course-item-wrapper" ' . $item_id . $margin_style . ' >';
    // query course section
    $args = array('post_type' => 'course', 'suppress_filters' => false);
    $args['posts_per_page'] = empty($settings['num-fetch']) ? '3' : $settings['num-fetch'];
    $args['orderby'] = empty($settings['orderby']) ? 'post_date' : $settings['orderby'];
    $args['order'] = empty($settings['order']) ? 'desc' : $settings['order'];
    $args['paged'] = get_query_var('paged') ? get_query_var('paged') : 1;
    if (!empty($settings['category'])) {
        $args['tax_query'] = array(array('terms' => explode(',', $settings['category']), 'taxonomy' => 'course_category', 'field' => 'slug'));
    }
    if (!empty($settings['course_id'])) {
        $args['post__in'] = $settings['course_id'];
    }
    $query = new WP_Query($args);
    $settings['course-layout'] = empty($settings['course-layout']) ? 'fitRows' : $settings['course-layout'];
    $settings['course-size'] = empty($settings['course-size']) ? 3 : $settings['course-size'];
    if ($settings['course-style'] == 'grid') {
        if ($settings['course-layout'] == 'carousel') {
            gdlr_lms_print_course_grid_carousel($query, $settings['thumbnail-size'], $settings['course-size']);
        } else {
            gdlr_lms_print_course_grid($query, $settings['thumbnail-size'], $settings['course-size']);
        }
    } else {
        if ($settings['course-style'] == 'grid-2') {
            if ($settings['course-layout'] == 'carousel') {
                gdlr_lms_print_course_grid2_carousel($query, $settings['thumbnail-size'], $settings['course-size']);
            } else {
                gdlr_lms_print_course_grid2($query, $settings['thumbnail-size'], $settings['course-size']);
            }
        } else {
            if ($settings['course-style'] == 'medium') {
                gdlr_lms_print_course_medium($query, $settings['thumbnail-size']);
            } else {
                if ($settings['course-style'] == 'full') {
                    gdlr_lms_print_course_full($query, $settings['thumbnail-size'], $settings['num-excerpt']);
                }
            }
        }
    }
    if ($settings['pagination'] == 'enable') {
        echo gdlr_lms_get_pagination($query->max_num_pages, $args['paged']);
    }
    echo '</div>';
    // course-item-wrapper
}