Disable course video in course block

Home Forums Legacy Support Support queries How-to & Troubleshooting Disable course video in course block

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #192536
    gsjaak
    Spectator
    Hi guys! Really like the new course video option, it works like a charm on the course pages :). However, I don't like it in the course blocks and course directory. My users expect to visit the course page when they click the picture of the course block (and not expect a video). How can I disable the course video in the course blocks (like the carousel and course directory) but keep the video on the specific course pages (there its awesome!). Kind regards
    #192665
    Anshuman Sahu
    Keymaster
        please try adding this given code in your wplms-customizer.php file in wplms customizer plugin :   add_action('init',function (){   $filters = bp_course_filters::init();   remove_filter('bp_course_get_avatar',array($filters,'video_thumbnail_html'));   remove_filter('wplms_featured_component_filter',array($filters,'wplms_featured_component'),10,4); });     add_action('wp_head',function (){   if(is_singular('course'))   $filters = bp_course_filters::init();   add_filter('bp_course_get_avatar',array($filters,'video_thumbnail_html'));   add_filter('wplms_featured_component_filter',array($filters,'wplms_featured_component'),10,4); });
    #192685
    gsjaak
    Spectator
    Hi! thanks for getting back. It almost works. The code removes the video in the directory, which is good. However, in the course carousels it also removes the featured image from the course blocks. Can this be fixed? I also see that when you load the course directory you firstly see a glimp of the video button before all the courses are loaded.
    #192838
    gsjaak
    Spectator
    Also the related courses on the course page (at the bottom), still shows the course video.
    #192839
    logan
    Member
    Well we have removed the course video feature filter from everywhere except on single course page with the above code . In course video feature I have handled the case in which course avatar is not set . But normally this is not handled . So please check if course featured image is set or not : http://prntscr.com/m8enez
    #192847
    gsjaak
    Spectator
    Ah I see now, there is an error in the code you send. The if statement in the second code is missing it should be:

    add_action('wp_head',function (){

    if(is_singular('course')) {

    $filters = bp_course_filters::init();

    add_filter('bp_course_get_avatar',array($filters,'video_thumbnail_html'));

    add_filter('wplms_featured_component_filter',array($filters,'wplms_featured_component'),10,4);

    }

    });

    However, now on the course page it still shows the course video in the related courses section. How can I remove it from that block?
    #192986
    Anshuman Sahu
    Keymaster
    thanks for correcting the code there . add this one also to disable avatar video in related courses secction on single course page : add_action('wplms_single_course_content_end',function (){   $filters = bp_course_filters::init();   remove_filter('bp_course_get_avatar',array($filters,'video_thumbnail_html'));   remove_filter('wplms_featured_component_filter',array($filters,'wplms_featured_component'),10,4); },1);
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Disable course video in course block’ is closed to new replies.