How Do I Make a Video Lightbox in WordPress?

Making a lightbox in WordPress is simple, and there are a few different ways to go about it. One option is to use the WPBakery Page Builder Plugin, which gives you a variety of built-in lightbox templates to choose from.

Alternatively, you can use the WordPress customizer to create your own lightbox template.

Once you have created your lightbox, you will need to add some code to your WordPress site. To start, open your WordPress site in your web browser, and go to the Dashboard.

In the left-hand column, click on the Appearance menu item, and then click on the Widgets tab. In the Widgets section, click on the Add New Widget button.

In the appeared window, select the Lightbox widget, and then click on the Choose File button. In the opened window, select the folder where you want to place your lightbox template, and then click on the Upload File button.

Finally, enter the code that appears in the below box, and then click on the Add button.

function my_lightbox() { // Get the current post ID $post_id = get_the_ID(); // Create a template object $template = new WPBakeryPageBuilder_Lightbox( $post_id ); // Display the template echo $template->display(); }

The final step is to add a link to your lightbox in the WordPress admin area. To do this, go to the Posts section of your WordPress site, and then click on the link to the post you want to add the lightbox to.

In the appeared window, enter the code that appears in the below box, and then click on the Save button.

/images/lightbox-thumb.jpg” alt=”” />

Conclusion

Making a lightbox in WordPress is easy to do, and there are a variety of options available to you. If you use the WPBakery Page Builder Plugin, you can use pre-built templates or create your own.

Alternatively, you can use the WordPress customizer to create a template. Once you have created your lightbox, you will need to add code to your WordPress site to display it.