Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,174,157 members, 7,890,920 topics. Date: Tuesday, 16 July 2024 at 01:04 AM

How To Make Your Videos Responsive In Wordpress - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / How To Make Your Videos Responsive In Wordpress (271 Views)

Step-by-step Guide On How To Embed A Facebook Video In Wordpress / Onclick Event In Wordpress Help / How Do I Edit This In Wordpress Style Sheet (2) (3) (4)

(1) (Reply)

How To Make Your Videos Responsive In Wordpress by princekweks(m): 10:14pm On Jul 28, 2017
it is 2017, having non-responsive content on your website will cost you your users. Most WordPress themes have this issue of not automatically scaling your embedded videos when viewed on mobile, even though other parts of the website scales. This makes your videos a bit useless to mobile users. A non-mobile friendly website is bad for SEO
Non-responsive vs Responsive design
Non-responsive vs Responsive design

In this article, I’ll be showing you how to use a free Plugin – FitVids to automatically scale all your videos when viewed on mobile.

If you prefer not to install plugins, I’ll show you how to do this Programmatically.

FitVids is a Jquery plugin developed by Kevin Dees.

To fix the issue with this plugin simply install and activate the plugin, that’s all!

Your videos will now be well structured and very responsive on mobile devices. If you are not sure how to install plugins, you might want to go through my WordPress tutorial for starters.

Doing It Programmatically.

If you prefer not to install the plugin the plugin to your dashboard, perhaps you want to get your hands dirty with code, here is how.

First, you’ll need to download and extract FitVids Jquery plugin to your computer. Then extract the FitVids.js-master folder and upload it to your theme’s js directory.

If your theme does not have a JS directory, simply create one and then upload the file into it.

Inside the js folder, you need to create a new file and name it as FitVids.js. Copy the code below and paste it into the JS file you just created.

(function($) {
$(document).ready(function(){
// Target your .container, .wrapper, .post, etc.
$(".post&quotwink.fitVids();
});

})(jQuery);

What the above code does is that it tells FitVids to look for .post CSS Selector.

After this, edit your functions.php file in your theme and add the code below.

wp_enqueue_script('fitvids', get_template_directory_uri() . '/js/FitVids.js-master/jquery.fitvids.js', array('jquery'), '', TRUE);
wp_enqueue_script('fitvids-xtra', get_template_directory_uri() . '/js/FitVids.js', array(), '', TRUE);


And that’s all . Congratulations! You just worked on your WordPress installation like a Badass! Your videos will be responsive on mobile devices now.

Did this work for you? Please tell me in the comment section below.

Source : https://w3tutor.org/wordpress/make-videos-responsive-wordpress/

(1) (Reply)

For Beginner's - See How Keywords Is Importance In SEO / How To Speed Up Your Website/blog. / Non Hosted Nigerian Adsense Account For Sale At Cheap Rate.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.