Skip to content

Instantly share code, notes, and snippets.

@MrVibe
Created April 2, 2020 04:27
Show Gist options
  • Save MrVibe/03e39ce8181aa6cea1820c7eb5d940a7 to your computer and use it in GitHub Desktop.
Save MrVibe/03e39ce8181aa6cea1820c7eb5d940a7 to your computer and use it in GitHub Desktop.
singleItem with course button & details
add_filter('bp_course_single_item_view',function($flag){
global $post;
$course_post_id = $post->ID;
$course_author= $post->post_author;
$course_classes = apply_filters('bp_course_single_item','course_single_item course_id_'.$post->ID.' course_status_'.$post->post_status.' course_author_'.$post->post_author,get_the_ID());
?>
<li class="<?php echo $course_classes; ?>">
<div class="row">
<div class="col-md-4">
<div class="item-avatar" data-id="<?php echo get_the_ID(); ?>">
<?php bp_course_avatar(); ?>
</div>
</div>
<div class="col-md-6">
<div class="item">
<div class="item-title"><?php bp_course_title(); if(get_post_status() != 'publish'){echo '<i> ( '.get_post_status().' ) </i>';} ?>
</div>
<div class="item-meta"><?php bp_course_meta(); ?></div>
<div class="item-desc"><?php bp_course_desc(); ?></div>
<?php
$enable_instructor = apply_filters('wplms_display_instructor',true,$post->ID);
if($enable_instructor){
?>
<div class="item-instructor">
<?php bp_course_instructor(array('instructor_id'=> $course_author)); ?>
</div>
<?php } ?>
<div class="item-action"><?php bp_course_action() ?></div>
<?php do_action( 'bp_directory_course_item' ); ?>
</div>
</div>
<div class="col-md-2">
<div class="item-credits">
<?php
the_course_button();
the_course_details();
?>
</div>
</div>
</div>
</li>
<?php
return 1;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment