Embed a Custom Welcome Video Above Analytics in Dokan DashboardEmbed a Custom Welcome Video Above Analytics in Dokan Dashboard

Hello guys how are you? Welcome back to my blog therichpost.com. Guys today in this post, I will tell show you Embed a Custom Welcome Video Above Analytics in Dokan Dashboard.

Guys if you are new in  WordPress or in  WooCommerce then please check the below links for some good tutorials:
  1. WooCommerce Hooks
  2. WordPress Tricks
  3. WordPress Hooks
  4. Dokan

Here is the working steps for Embed a Custom Welcome Video Above Analytics in Dokan Dashboard.

Here’s a step-by-step guide using the best method — adding via a hook with a bit of PHP code:


Step-by-Step: Embed Video Above Analytics in Dokan Vendor Dashboard

🛠️ 1. Find the Right Hook

Dokan provides hooks in the vendor dashboard templates. The most suitable is:

do_action( 'dokan_dashboard_content_before' );

This hook is triggered before dashboard content like analytics, so it’s perfect for embedding a welcome video.


📁 2. Add Code to Your Theme’s functions.php File

add_action( 'dokan_dashboard_content_before', 'custom_welcome_video_for_vendor', 5 );

function custom_welcome_video_for_vendor() {
    // Check if the user is a vendor
    if ( dokan_is_seller_dashboard() ) {
        echo '<div class="dokan-welcome-video" style="margin-bottom: 20px;">';
        echo '<h3>Welcome to Your Dashboard</h3>';
        echo '<iframe width="100%" height="315" src="https://www.youtube.com/embed/YOUR_VIDEO_ID" frameborder="0" allowfullscreen></iframe>';
        echo '</div>';
    }
}

🔁 Replace YOUR_VIDEO_ID with your actual YouTube or Vimeo video ID.


🎨 Optional: Add Some CSS

You can style the video container if needed:

.dokan-welcome-video {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

Add this to your theme’s custom CSS or via the Customizer > Additional CSS.


Embed a Custom Welcome Video Above Analytics in Dokan Dashboard
Embed a Custom Welcome Video Above Analytics in Dokan Dashboard

💡 Tip:

If you want different videos for different vendor roles (e.g., new vs. existing), you can add more logic in the custom_welcome_video_for_vendor() function and for this feel free to comment below.


Ajay

Thanks

By therichpost

Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 19, MedusaJs, Next.js, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.