Adding training videos to your WordPress dashboard is an effective way to assist your team or clients. This tutorial shows you how to do this using code snippets.
Prerequisites
Please make sure you have the following installed and activated:
- Navigate to
Dashboard > Code Snippets > Add New
to create a new code snippet. - Name it “Training Videos for Dashboard”.
- Copy the code below:
function add_training_section_to_admin_menu() { add_menu_page( 'Training Videos', 'Training Videos', 'manage_options', 'training-videos', 'display_training_videos_page', 'dashicons-video-alt2', 30 ); } function display_training_videos_page() { $videos = array( array( 'title' => 'How to Start a Web Design Business Super Course', 'url' => 'https://www.youtube.com/watch?v=1SWArSD0C34', ), array( 'title' => 'Page Speed Performance Boost', 'url' => 'https://www.youtube.com/watch?v=P4nepzKE0Fs', ), array( 'title' => 'How to Get Clients', 'url' => 'https://www.youtube.com/watch?v=NIye1vlSPYU', ), ); ?> <div class="wrap"> <h1>Training Videos</h1> <ul> <?php foreach ( $videos as $video ) : ?> <li> <a href="<?php echo esc_url( $video['url'] ); ?>" target="_blank"><?php echo esc_html( $video['title'] ); ?></a> </li> <?php endforeach; ?> </ul> </div> <?php } add_action( 'admin_menu', 'add_training_section_to_admin_menu' );
Source: Code Snippets
- Paste the copied code into the code area of your new snippet in WordPress.
- Replace the placeholders for descriptions and URLs with your own content.
- Click on
Save Changes and Activate
. - Navigate to your WordPress dashboard.
- Look for the “Training Videos” section to confirm the videos have been added.
Add Training Videos to WordPress Dashboard – Conclusion
You’ve successfully added training videos to your WordPress dashboard using code snippets. This method is efficient and keeps your functions.php file clean.