Skip to content

Instantly share code, notes, and snippets.

@99manish
Created October 7, 2019 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 99manish/f34193fa70db02f6f7b61f19468fbadf to your computer and use it in GitHub Desktop.
Save 99manish/f34193fa70db02f6f7b61f19468fbadf to your computer and use it in GitHub Desktop.
add_filter('bp_course_single_item_view','custom_bp_course_single_item_view');
function custom_bp_course_single_item_view($x){
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 col-sm-4">
<div class="item-avatar" data-id="<?php echo get_the_ID(); ?>">
<?php bp_course_avatar(); ?>
</div>
</div>
<div class="col-md-8 col-sm-8">
<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 1111 "><?php the_excerpt(); ?></div>
<div class="item-credits">
<?php
if(function_exists('bp_course_is_member') && function_exists('the_course_button') && is_user_logged_in() && bp_course_is_member(get_the_ID(),get_current_user_id())){
the_course_button(get_the_ID());
}else{
bp_course_credits();
}
?>
</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>
</li>
<?php
return 1 ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment