Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Change Home button link on Single Course
- This topic has 4 replies, 3 voices, and was last updated 7 years, 6 months ago by H.K. Latiyan.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
June 6, 2016 at 4:24 am #51856VikasSpectatorHello, I want to change the link of Home button on single course section. Right now it is taking to me the course home but I want to add a custom link on that which will take me to the another page. And please also tell me that how can I add a another link or button in that menu. I want to add a dashboard button in that navigation so students can go to his dashboard by clicking on that. Thank youJune 6, 2016 at 7:38 am #51887VikasSpectatorI have Done it by my self I made change in file bp-course-function.php Default code was this: function bp_course_nav_menu(){ $defaults = array( 'Home' => array( 'id' => 'home', 'label'=>__('Home','vibe'), 'action' => '', 'link'=>bp_get_course_permalink(), ), 'curriculum' => array( 'id' => 'curriculum', 'label'=>__('Curriculum','vibe'), 'action' => 'curriculum', 'link'=>bp_get_course_permalink(), ), 'members' => array( 'id' => 'members', 'label'=>__('Members','vibe'), 'action' => 'members', 'link'=>bp_get_course_permalink(), ), ); Then I changes in to like this: function bp_course_nav_menu(){ $user_id=get_current_user_id(); $link= apply_filters ( 'wplms_registeration_redirect_url', bp_core_get_user_domain( $user_id ).WPLMS_DASHBOARD_SLUG , $user_id ); $defaults = array( 'Home' => array( 'id' => 'dashboard', 'label'=>__('Dashboard','vibe'), 'action' => 'dashboard', 'link'=>$link, ), 'startcourse' => array( 'id' => 'home', 'label'=>__('Start Course','vibe'), 'action' => '', 'link'=>bp_get_course_permalink(), ), 'curriculum' => array( 'id' => 'curriculum', 'label'=>__('Curriculum','vibe'), 'action' => 'curriculum', 'link'=>bp_get_course_permalink(), ), 'members' => array( 'id' => 'members', 'label'=>__('Members','vibe'), 'action' => 'members', 'link'=>bp_get_course_permalink(), ), ); Result is shown in AttachmentJune 6, 2016 at 10:50 am #51917H.K. LatiyanParticipantPlease do not make changes in the plugin files directly because when the new update will be available then all your customizations will be lost if you update it. So to keep the customizations even after update, perform all the customizations in the wplms-customizer.php file present in your wplms customizer plugin or use a blank child theme for customizations. For the above please remove the changes that you made in vibe course module plugin and instead use this code in your wplms-customizer.php file: add_filter('wplms_course_nav_menu','wplms_course_custom_nav_menu_item'); function wplms_course_custom_nav_menu_item($course_menu){ $link = 'https://www.google.co.in/'; $course_menu['custom']=array( 'id' => 'custom', 'label'=>__('Custom Link','vibe'), 'link'=> $link, ); $course_menu['']=array( 'id' => 'dashboard', 'label'=>__('Dashboard','vibe'), 'link'=> bp_loggedin_user_domain().WPLMS_DASHBOARD_SLUG, ); return $course_menu; }May 11, 2017 at 10:14 pm #111744qclearninglabSpectatorWith the above code, how do you set the custom link to open in a new window?May 12, 2017 at 1:56 pm #111807H.K. LatiyanParticipantHi.. Please create your own topics for your issues. For creating custom sections in course menu, now you do not need to use the code, you can use the wplms course custom nav plugin, refer: https://vibethemes.com/documentation/wplms/knowledge-base/wplms-course-custom-nav-plugin/ PS: Its not possible to open the link in new tab as of now, but in wplms 2.9 version it will be possible.
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
- The topic ‘Change Home button link on Single Course’ is closed to new replies.