• Resolved marktc99

    (@marktc99)


    Hi there,

    I’m hoping to remove the tabs at the top of the student dashboard so I can create a sidebar menu instead. I found the below php code and pasted in into my divi child theme’s functions.php file but it doesn’t seem to have done anything. Can anyone let me know what I may have done wrong? Here is all the code in my funtions.php file (the first two lines were already there):

    <?php
    remove_filter(‘pre_user_description’, ‘wp_filter_kses’);

    /**
    * Remove tabs from the LifterLMS Student dashboard
    * @param array $tabs registered tabs
    * @return array
    */
    function my_remove_dashboard_tabs( $tabs ) {
    // unset( $tabs[‘my-courses’] );
    // unset( $tabs[‘view-achievements’] );
    // unset( $tabs[‘notifications’] );
    // unset( $tabs[‘edit-account’] );
    // unset( $tabs[‘redeem-voucher’] );
    // unset( $tabs[‘orders’] );
    // unset( $tabs[‘signout’] );
    return $tabs;
    }
    add_filter( ‘llms_get_student_dashboard_tabs’, ‘my_remove_dashboard_tabs’ );

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @marktc99,

    /**
    * Remove tabs from the LifterLMS Student dashboard
    * @param array $tabs registered tabs
    * @return array
    */
    function my_remove_dashboard_tabs( $tabs ) {
    unset( $tabs[‘my-courses’] );
    // unset( $tabs[‘view-achievements’] );
    // unset( $tabs[‘notifications’] );
    // unset( $tabs[‘edit-account’] );
    // unset( $tabs[‘redeem-voucher’] );
    // unset( $tabs[‘orders’] );
    // unset( $tabs[‘signout’] );
    return $tabs;
    }
    add_filter( ‘llms_get_student_dashboard_tabs’, ‘my_remove_dashboard_tabs’ );

    You’ll remove the beginning slash at the front of the tabs you want to remove. The code I used above helps in removing “My Courses”. Remove the other // to activate the removal of other tabs.

    Thank you 🙂

    Thread Starter marktc99

    (@marktc99)

    Hi Toyin,

    Thanks for that. My php skills are fairly limited 🙂

    I managed to get most of the tabs however I can’t seem to get rid of the dashboard tab. If I put this line in:

    unset( $tabs[‘dashboard’] );

    it removes the entire content.

    Is there something else I can do to remove the dashboard tab?

    Thanks
    Mark

    Thread Starter marktc99

    (@marktc99)

    Hi Toyin,

    I have another question on this topic. What I’m trying to achieve it to remove the tabs from the top of the dashboard but I still want to be able to access each tab via a menu I’ve made in the sidebar of the student dashboard page. However when I add the php to remove the tabs, I can no longer bring up the content by clicking on my menu links such as:

    /dashboard/my-courses/
    /dashboard/my-grades/

    Is there a way I can remove all the links at the top of the dashboard but still be able to access the end points through my menu?

    Thanks
    Mark

    Thread Starter marktc99

    (@marktc99)

    Hi Toyin,

    I think I’ve solved this. I just added this to my functions.php and everything seems to be working as I want it to:

    remove_action( ‘lifterlms_student_dashboard_header’, ‘lifterlms_template_student_dashboard_navigation’, 10 );

    Thanks for your help.

    Glad you’ve been able to resolve the issue now @marktc99.

    Have a great day! 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Removing Dashboard Tabs’ is closed to new replies.