Created
July 27, 2022 23:26
-
-
Save DumahX/3830ac36a532276de5d9fc392b21f681 to your computer and use it in GitHub Desktop.
Add featured image thumbnail on courses list.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if(!defined('ABSPATH')) {die('You are not allowed to call this page directly.');} ?> | |
<style> | |
.mpcs-course-thumbnail { | |
vertical-align: middle; | |
} | |
.grid .col-1-2:last-of-type { | |
padding-top: 50px; | |
} | |
</style> | |
<div class="mp_wrapper"> | |
<?php foreach($my_courses as $course): ?> | |
<div class="grid"> | |
<div class="col-1-2 grid-pad"> | |
<?php echo get_the_post_thumbnail( $course->ID, array( 100, 100 ), array( 'class' => 'mpcs-course-thumbnail' ) ); ?> | |
<a href="<?php echo get_permalink($course->ID); ?>"> | |
<?php echo $course->post_title; ?> | |
</a> | |
</div> | |
<div class="col-1-2 grid-pad"> | |
<?php if($show_bookmark === true): ?> | |
<div class="course-progress"> | |
<div class="user-progress <?php echo $course->user_progress($current_user->ID) == 0 ? 'center-block' : '' ?>" data-value="<?php echo $course->user_progress($current_user->ID); ?>"> | |
</div> | |
</div> | |
<?php endif; ?> | |
</div> | |
</div> | |
<?php endforeach; ?> | |
<div class="navigation"> | |
<div class="alignleft"> | |
<?php previous_posts_link( __('« Previous', 'memberpress-courses') ); ?> | |
</div> | |
<div class="alignright"> | |
<?php next_posts_link( __('Next »', 'memberpress-courses'), $course_query->max_num_pages); ?> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment