Change Home button link on Single Course

Home Forums Legacy Support Support queries How-to & Troubleshooting Change Home button link on Single Course

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #51856
    Vikas
    Spectator
    Hello, 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 you
    #51887
    Vikas
    Spectator
    I 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 Attachment
    #51917
    H.K. Latiyan
    Participant
    Please 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; }
    #111744
    qclearninglab
    Spectator
    With the above code, how do you set the custom link to open in a new window?
    #111807
    H.K. Latiyan
    Participant
    Hi.. 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.  
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Change Home button link on Single Course’ is closed to new replies.