tutor-instructor.php
53 lines
| 1 | <div class="tutor-courses tutor-courses-loop-wrap tutor-courses-layout-<?php echo $column_count; ?>"> |
| 2 | <?php |
| 3 | foreach($instructors as $instructor){ |
| 4 | |
| 5 | $course_count = tutor_utils()->get_course_count_by_instructor($instructor->ID); |
| 6 | $instructor_rating = tutor_utils()->get_instructor_ratings($instructor->ID); |
| 7 | ?> |
| 8 | <div class="tutor-course-col-<?php echo $column_count; ?>"> |
| 9 | <a href="<?php echo tutor_utils()->profile_url($instructor->ID); ?>" class="tutor-course tutor-course-loop tutor-instructor-list tutor-instructor-list-<?php echo $layout; ?> tutor-instructor-list-<?php echo $instructor->ID; ?>"> |
| 10 | <div class="tutor-instructor-cover-photo" style="background-image:url(<?php echo tutor_utils()->get_cover_photo_url($instructor->ID); ?>)"></div> |
| 11 | <div class="tutor-instructor-profile-photo" style="background-image:url(<?php echo get_avatar_url($instructor->ID, array('size'=>500)); ?>)"></div> |
| 12 | <div class="tutor-instructor-rating"> |
| 13 | <div class="ratings"> |
| 14 | <span class="rating-generated"> |
| 15 | <?php tutor_utils()->star_rating_generator($instructor_rating->rating_avg); ?> |
| 16 | </span> |
| 17 | |
| 18 | <?php |
| 19 | echo " <span class='rating-digits'>{$instructor_rating->rating_avg}</span> "; |
| 20 | echo " <span class='rating-total-meta'>({$instructor_rating->rating_count})</span> "; |
| 21 | ?> |
| 22 | </div> |
| 23 | </div> |
| 24 | <h4 class="tutor-instructor-name"><?php echo $instructor->display_name; ?></h4> |
| 25 | <div class="tutor-instructor-course-count"> |
| 26 | <span><?php echo $course_count; ?></span> |
| 27 | <span><?php $course_count>1 ? _e('Courses', 'tutor') : _e('Course', 'tutor'); ?></span> |
| 28 | </div> |
| 29 | </a> |
| 30 | </div> |
| 31 | <?php |
| 32 | } |
| 33 | |
| 34 | if(!count($instructors)){ |
| 35 | echo '<div>', __('No Instructor Found', 'tutor'), '</div>'; |
| 36 | } |
| 37 | ?> |
| 38 | </div> |
| 39 | |
| 40 | <?php |
| 41 | if($previous_page || $next_page) { |
| 42 | $prev_url = !$show_filter ? '?instructor-page='.$previous_page : '#'; |
| 43 | $next_url = !$show_filter ? '?instructor-page='.$next_page : '#'; |
| 44 | ?> |
| 45 | <div class="tutor-pagination-wrap"> |
| 46 | <?php |
| 47 | echo $previous_page ? '<a class="page-numbers" href="'.$prev_url.'" data-page_number="'.$previous_page.'">« '.__('Previous', 'tutor').'</a>' : ''; |
| 48 | echo $next_page ? ' <a class="next page-numbers" href="'.$next_url.'" data-page_number="'.$next_page.'">'.__('Next', 'tutor').' »</a>' : ''; |
| 49 | ?> |
| 50 | </div> |
| 51 | <?php |
| 52 | } |
| 53 | ?> |