Facebook is one of the most popular social media platforms on the web, along with millions of users actively participating in it every day. Due to its immense popularity and users, more and more WordPress users are connecting their websites with Facebook with the aim of achieving successful Facebook marketing to drive traffic to the website. For example by adding a Facebook button, embedding Facebook posts and creating a custom Facebook page or page.
In this tutorial, I want to show you another way to integrate facebook with your WordPress site by attaching Facebook videos to your WordPress site.
Putting Facebook Videos on WordPress
First of all, you have to target the Facebook video that you want to put on your WordPress site, and copy the link address.
Then, you have to visit the facebook site here to generate the url into a script to be installed in WordPress. You can post on the Video URL. Before generating code, you need to adjust the width of the video to fully meet the overall design of your web page. Then, click the “Get Code” button.
Now, you will see a pop-up window appear with two boxes of code required to be entered on your WordPress site in different ways.
The coding stuff flaunted into the first box needs to be pasted into the header section of your site right after opening the “body” tag. Here, you can do this via two methods.
Modifying Code via WordPress Admin
WordPress gives you a lot of freedom to edit your theme files. For this, you just need to log into your WordPress dashboard and click on it Appearance »Editor. Then, look at some of the links on the right, you have to select the header.php file and click, paste the code after the “body” tag.
Use a Plugin
If you don’t like editing your website files in the editor, you can choose to use a plugin Insert Header and Footer
. After installing and activating the plugin, you only need to enter the menu Settings »Insert Header and Footer. Then, enter the code from the Facebook embed video into the empty field “Script in Header”.
2. Embed Facebook Video Code into WordPress
The second box of code displayed can be pasted directly into your blog posts, web pages and even sidebar widgets, this is an option you should copy. In fact, this part of the coding also contains the general settings of the absolute video embed URL, width, and video title and date posted. However, you can also add the following attributes manually into the code.
- If you want your Facebook video to be showcased in full screen mode, you can enter the line: data-allowfullscreen = “true”.
- If you want the video to play automatically when the web page is loaded, you can enter the line: data-autoplay = “true”.
Two Simple Alternative Ways:
If you view a Facebook video by entering its link address into the address bar, you can find the “Embed Video” button. After clicking, you will see a selection of codes that need to be pasted at any location you want in your pages, posts and sidebars.
Without a doubt, this method is much more time-saving than before, but can lead to more bandwidth consumption when loading videos.
If this video was shared by another Facebook user but you are not, you can first re-share it on your Facebook profile. Then, you just have to embed this specific Facebook post into your WordPress site.
The downside of this option is that you cannot display pure videos on your posts. Also, this method doesn’t allow you to embed videos into the sidebar of your web page.
The following are several ways to add a Facebook embed video to a WordPress site, I hope the tutorial above is useful. 🙂