Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Kupası
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

FitVids ile WordPress’te Videolarınızı Nasıl Duyarlı Hale Getirebilirsiniz?

WordPress’e bir video yerleştirdiğinizde, varsayılan olarak bu videolar duyarlı değildir. Duyarlı WordPress temalarının yükselişiyle birlikte, sitenizi daha küçük ekranlarda ziyaret eden kullanıcılar, uzatılmış ve orantısız video kapsayıcıları göreceklerdir. Bu makalede, FitVids ile WordPress’te videolarınızı nasıl duyarlı hale getireceğinizi göstereceğiz.

Default non-responsive and responsive video embeds in WordPress

FitVids, video yerleştirmelerinizi duyarlı hale getirmenizi sağlayan bir jQuery eklentisidir. WordPress sitenizde kullanmak istiyorsanız, tek yapmanız gereken FitVids for WordPress eklentisini yüklemek ve etkinleştirmektir. Etkinleştirdikten sonra Görünüm ” FitVids bölümüne gitmeniz ve bir CSS seçici sınıfı girmeniz gerekir. WordPress makalelere otomatik olarak .post sınıfı ekler, bu yüzden bunu kullanabilirsiniz.

FitVids for WordPress plugin settings

Hepsi bu kadar, değişikliklerinizi kaydedin ve sitenizi önizleyin. Videoların kendilerini buna göre ayarladığını görmek için tarayıcı ekranını yeniden boyutlandırmanız gerekir.

Video Eğitimi

Subscribe to WPBeginner

Videoyu beğenmediyseniz veya daha fazla talimata ihtiyacınız varsa, okumaya devam edin.

WordPress’te Videolarınızı Duyarlı Hale Getirmek için FitVids’i Manuel Olarak Ekleyin

WordPress için FitVids eklentisini yüklemek istemiyorsanız, FitVids jQuery eklentisini manuel olarak ekleyebilirsiniz. Yapmanız gereken ilk şey FitVids jQuery eklentisini bilgisayarınıza indirmek ve çıkarmaktır. Şimdi çıkarılan FitVids .js-master klasörünü temanızın js dizinine yüklemeniz gerekiyor.

Filezilla gibi bir FTP istemcisi kullanarak web sitenize bağlanmanız ve tema dizininizi açmanız gerekir. WordPress temanızda bir js klasörü olmayabilir. Eğer yoksa, bir tane oluşturmanız ve ardından FitVids.js-master klasörünü bilgisayarınızdan yüklemeniz gerekir.

js klasörünün içinde yeni bir dosya oluşturmanız ve adını FitVids.js koymanız gerekir. Bu dosyayı düzenleyin ve bu kodu içine yapıştırın.

(function($) {
  $(document).ready(function(){
    // .container, .wrapper, .post vb. öğelerinizi hedefleyin.
    $(".post").fitVids();
  });
  
  })(jQuery);

Yukarıdaki kod FitVids’e .post CSS seçici sınıfını aramasını söyler. Artık FitVids’i hazırladığınıza göre, WordPress temanıza javascriptleri düzgün bir şekilde eklemenin zamanı geldi.

Basitçe, aşağıdaki kodu kopyalayıp temanızın functions.php dosyasına yapıştırın:

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);

Bunu yaptıktan sonra, işiniz bitti. WordPress videolarınızı başarılı bir şekilde duyarlı hale getirdiniz.

Bu makaleyi faydalı bulduğunuzu umuyoruz. Geri bildirim ve sorularınız için lütfen aşağıya yorum bırakmaktan çekinmeyin veya Twitter ve Google+‘da bize katılın.

Açıklama: İçeriğimiz okuyucu desteklidir. Bu, bazı bağlantılarımıza tıklarsanız komisyon kazanabileceğimiz anlamına gelir. WPBeginner'ın nasıl finanse edildiğini, neden önemli olduğunu ve nasıl destek olabileceğinizi görün. İşte editoryal sürecimiz.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Ultimate WordPress Araç Kiti

Araç setimize ÜCRETSİZ erişim sağlayın - her profesyonelin sahip olması gereken WordPress ile ilgili ürün ve kaynaklardan oluşan bir koleksiyon!

Reader Interactions

16 yorumBir Cevap Bırakın

  1. Syed Balkhi

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Joe Bowls

    This no longer applies. Plugin has been updated. It no longer works for me.

    • WPBeginner Support

      We will be sure to take a look and consider alternatives when we next update this post :)

      Yönetici

  3. smithy

    Not perfect, but with Jetpack, and WP ‘out of the box’, this css will make youtube video embeds fit 100% content width responsively – requiring no plugins etc. so very ‘compact’. The ‘padding’ keeps the aspect ratio.

    span.embed-youtube {
    position: relative;
    padding-bottom: 56.25%;
    padding-top: 18px; height: 0; overflow: hidden;
    }

    span.embed-youtube iframe,
    span.embed-youtube object,
    span.embed-youtube embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    }

    If it helps anyone.

  4. Flemming

    This works perfectly for me (self hosted WP site). I originally used a plugin called Advanced Responsive Video Embedder which is really good but it didn’t play nicely with OptimizePress plugin.

    The FitVids plugin does exactly what I need with no problems (so far!) – thanks so much for writing this post, saved me a headache!

  5. Danny

    A post about how to embed responsive videos yet the video in the post itself is not responsive… hmmm

  6. Anthony baker

    You should add that you cannot add plugins with free version of wordpress.com. :-(

    • Anthony baker

      OH, it seems this article is for wordpress.org. So confusing. So if I have the premium version of WordPress.com can I add this plugin?

  7. Gabor

    The other thing is that,in case i set .post-entry /that is for me/

    than all the post will be responsive and the amazon widget that i add will be too.Which expands on the whole post…any workaround?

  8. flashbytes

    Is there a way to avoid multiple new js files? Wouldn’t it be possible to add this js (both files) to one that is already being loaded by default, so the page load doesn’t suffer as much as it would, if there were three files instead of one?

  9. Rob

    Thanks!!!! adding the

    .post, .page

    into the CSS selector worked great for me and the pages I have videos on…I have yet to add a blog post but I’m sure it should work fine with that since it worked for me on my pages

    THANKS!!!!

  10. raffaella paolone

    hello
    thank you for this article
    how about fitvids and videos in widgets?
    selector?

  11. Michael Boll

    Thanks for this great tip.

    Do you know of a plugin that will allow video to be seen on an ipad?

    We are a school using WOrdpress like crazy (self hosted) but when we upload video to our wordpress sites, it cannot be seen on an iPad.

    Looking for a plugin to fix this. Any suggestions?

    We can view all other videos on an iPad, just not ones hosted on our own wordpress server. Not sure why it does not render in HTML 5.

    Thanks,

    Mike

    • WPBeginner Support

      Michael, We think users should never upload videos to WordPress. We think embedding videos from a source like YouTube or Vimeo are a better alternative. However, if you must upload video, then WordPress comes with the video shortcode since version 3.6. Your videos must be in iPad supported format like mp4, m4v, ogv, mov, etc. You can also use a program like WinFF to convert your videos into iPad supported format.

      Yönetici

  12. Denis McCaul

    I have since researched and found that adding
    .post, .page
    rather than just .post means it now works for me on Posts and Pages.
    Any solutions to the incompatability with Plugin “Lazy Load for Videos” greatly appreciated.
    Thanks, Denis

  13. Denis McCaul

    I installed the plugin and followed your set up instructions, good news and bad.
    Good news, it works.
    Bad news
    1. It is not compatible with the Plugin “Lazy Load for Videos”. I had to deactivate that one for it to work. So page now takes longer to load especially if multiple videos.
    2. I added the .post CSS selector as advised in the settings. This makes it work on Blog posts but not on Video’s embedded on Pages. If you change .post to .page instead it will thenl work on pages but not posts.
    Any way to fix these problems?
    Thanks, Denis

Bir Cevap Bırakın

Yorum bırakmayı seçtiğiniz için teşekkür ederiz. Lütfen tüm yorumların yorum poli̇ti̇kasi uyarınca denetlendiğini ve e-posta adresinizin yayımlanmayacağını unutmayın. Ad alanında anahtar kelime KULLANMAYIN. Kişisel ve anlamlı bir sohbet edelim.