Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Disable course video in course block
Tagged: blocks, course video, directory
- This topic has 6 replies, 3 voices, and was last updated 5 years, 10 months ago by Anshuman Sahu.
Viewing 7 posts - 1 through 7 (of 7 total)
-
AuthorPosts
-
January 15, 2019 at 10:51 am #192536gsjaakSpectatorHi 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 regardsJanuary 16, 2019 at 8:03 am #192665Anshuman SahuKeymasterplease 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); });January 16, 2019 at 9:21 am #192685gsjaakSpectatorHi! 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.January 17, 2019 at 12:33 pm #192838gsjaakSpectatorAlso the related courses on the course page (at the bottom), still shows the course video.January 17, 2019 at 12:37 pm #192839loganMemberWell 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/m8enezJanuary 17, 2019 at 1:07 pm #192847gsjaakSpectatorAh 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?January 18, 2019 at 12:34 pm #192986Anshuman SahuKeymasterthanks 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); -
AuthorPosts
Viewing 7 posts - 1 through 7 (of 7 total)
- The topic ‘Disable course video in course block’ is closed to new replies.