October 26, 2023

Add Training Videos to WordPress Dashboard with Code Snippets

Play Video

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:


  1. Navigate to Dashboard > Code Snippets > Add New to create a new code snippet.
  2. Name it “Training Videos for Dashboard”.
  3. 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

  4. Paste the copied code into the code area of your new snippet in WordPress.
  5. Replace the placeholders for descriptions and URLs with your own content.
    Change code to your needs
  6. Click on Save Changes and Activate.
  7. Navigate to your WordPress dashboard.
  8. Look for the “Training Videos” section to confirm the videos have been added.
    Training Videos section has 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.

Required Resources

Code Snippets Logo
Free Options
Credit to Web Squadron
Web Squadron is a popular YouTube channel dedicated to providing informative tutorials, tips, and insights on web development and design. With a strong focus on WordPress and website builders like Bricks Builder, the channel aims to help users of all skill levels, from beginners to advanced developers, create and optimize their websites. By offering easy-to-understand, step-by-step guidance, Web Squadron provides practical and valuable content.
Visit
Add Training Videos to WordPress Dashboard with Code Snippets
Welcome back!
Enter your Helwp credentials to sign in.

No Account yet? Sign Up

My Account
Menu
Give Feedback
Describe your feedback *
Rate Helwp
Share
Facebook
Twitter
LinkedIn
Reddit
Email
WhatsApp
Telegram
Pocket
Report
Problem *
Describe the problem
Want us to reply?
Your E-Mail
Affiliate Disclosure

At Helwp, we’re committed to transparency and honesty. Therefore, we want to inform you that some of the links on our website are affiliate links. This means that, at no additional cost to you, we may earn a small commission if you click through and make a purchase.

We only promote products or services that we genuinely believe in. These affiliate commissions help us to maintain the website and continue to provide you with free, high-quality WordPress content.

If you are interested in how you can support us even further, check out our support page.