/*Reverse sticky header*/
  1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. How to Add Additional Tabs on the Courses Page

How to Add Additional Tabs on the Courses Page

By default, we do not have this option. You can use the follow LearnDash’s code base through this link: https://developers.learndash.com/hook/learndash_content_tabs/ to apply it, please see the steps below:

Note: Make sure to have a complete site backup before proceeding

    1. Go to Appearance – Theme Editor.

    2. Under Select theme to edit, choose (BuddyBoss Child/whatever theme is active), then click Select.

    3. Below Theme Files, select Theme Functions (functions.php).

    4. Append your code just before the closing PHP tag “?>”:

/** * Example usage for learndash_content_tabs filter. */ add_filter( 'learndash_content_tabs', function( $tabs = array(), $context = '', $course_id = 0, $user_id = 0 ) { // Add optional logic to show the custom tab only on certain courses. // If ( 123 === $course_id ) { // Add tab content here. // } // Add our Custom tab-1 Tab. if ( ! isset( $tabs['tab-1'] ) ) { $tabs['tab-1'] = array( 'id' => 'tab-1', // The value here is to a CSS class you control to show an icon. 'icon' => 'ld-tab-1-icon', 'label' => 'Tab 1', 'content' => '<p>Tab 1 Contents</p> ', ); } if ( ! isset( $tabs['tab-2'] ) ) { $tabs['tab-2'] = array( 'id' => 'tab-2', // The value here is to a CSS class you control to show an icon. 'icon' => 'ld-tab-2-icon', 'label' => 'Tab 2', 'content' => '<p>Tab 2 Contents</p> ', ); } if ( ! isset( $tabs['tab-3'] ) ) { $tabs['tab-3'] = array( 'id' => 'tab-3', // The value here is to a CSS class you control to show an icon. 'icon' => 'ld-tab-3-icon', 'label' => 'Tab 3', 'content' => '<p>Tab 3 Contents</p> ', ); } // Always return $tabs. return $tabs; }, 30, 4 );

Note: The above code is just sample, kindly coordinate with your personal developer to make the necessary changes. Make sure to mind the course ID for course specific contents

    5. Click Update File to save the changes.

Note: Any modifications are considered as custom work already. Know more about our Support Policy here: https://www.buddyboss.com/support-policy/

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Support

To speak to our Agency consultant, fill in the form found at our Contact Page.

"*" indicates required fields

Get Started

Enter your name and email address to get started with your project...

Name*