小工具      在线工具  汉语词典  dos游戏  css  js  c++  java

wordpress响应慢_如何使用FitVids在WordPress中使视频具有响应性

wordpress,python,php,java,web 额外说明

收录于:17天前

wordpress响应缓慢

When you 在 WordPress 中嵌入视频, by default these videos are not responsive. With the rise of 响应式 WordPress 主题, users visiting your site on smaller screens will see video containers that are stretched and disproportionate. In this article, we will show you how to make your videos responsive in WordPress with FitVids.

当您在 WordPress 中嵌入视频时 ,默认情况下,这些视频没有响应。 随着响应式 WordPress 主题的兴起,在较小屏幕上访问您的网站的用户将看到拉伸且比例过高的视频容器。 在本文中,我们将向您展示如何使用FitVids在WordPress中响应视频。

Default non-responsive and responsive video embeds in WordPress

FitVids is a jQuery plugin which allows you to make your video embeds responsive. If you want to use it on your WordPress site, then all you need to do is install and activate 适用于 WordPress 的 FitVids plugin. After activation, you need to go to 外观 » FitVids and enter a CSS selector class. WordPress automatically adds .post class to the articles, so you can just use that.

FitVids是一个jQuery插件,可让您使视频嵌入响应。 如果您想在WordPress网站上使用它,则只需安装并激活适用于 WordPress 的 FitVids插件即可。 激活后,您需要转到外观 »FitVids并输入CSS选择器类。 WordPress会自动在文章中添加.post类,因此您可以使用它。

FitVids for WordPress plugin settings

就这样,保存您的更改并预览您的网站。您需要重新调整浏览器屏幕的大小才能看到视频进行相应的调整。

就这样,保存更改并预览您的网站。您需要调整浏览器屏幕的大小才能看到视频进行相应调整。

影片教学 Video Tutorial

演示地址

如果您不喜欢该视频或需要更多说明,请继续阅读。

如果您不喜欢该视频或需要更多说明,请继续阅读。

手动添加FitVids以使您的视频在WordPress中具有响应性 Manually Add FitVids to Make Your Videos Responsive in WordPress

If you don’t want to install the FitVids for WordPress plugin, then you can add FitVids jQuery plugin manually. First thing you need to do is download and extract FitVids jQuery 插件 to your computer. Now you need to upload the extracted FitVids.js-master folder to your theme’s js directory.

如果您不想安装适用于WordPress的FitVids插件,则可以手动添加FitVids jQuery插件。 您需要做的第一件事是将FitVids jQuery 插件下载并解压缩到您的计算机中。 现在,您需要将提取的FitVids.js-master文件夹上载到主题的js目录。

You need to connect to your website 使用 FTP 客户端 like Filezilla and open your theme directory. It is possible that your WordPress theme may not have a js folder. If it is not there, then you need to create one and then upload FitVids.js-master folder from your computer.

您需要使用 FTP 客户端(例如Filezilla)连接到您的网站,然后打开主题目录。 您的WordPress主题可能没有js文件夹。 如果不存在,则需要创建一个文件夹,然后从计算机上载FitVids.js-master文件夹。

Inside the js folder, you need to create a new file and name it FitVids.js. Edit this file and paste this code inside it.

在js文件夹中,您需要创建一个新文件并将其命名为FitVids.js 。 编辑此文件并将此代码粘贴到其中。


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

The above code tells FitVids to look for .post CSS selector class. Now that you got FitVids ready, it is time to 正确添加 JavaScript in your WordPress theme.

上面的代码告诉FitVids寻找.post CSS选择器类。 现在您已经准备好FitVids,是时候在WordPress主题中正确添加javascript了。

Simply, copy and paste the following code in your theme’s functions.php file:

只需将以下代码复制并粘贴到主题的functions.php文件中:


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

一旦你这样做了,你就完成了。您已成功使您的 WordPress 视频具有响应能力。

一旦完成,就完成了。您已成功使您的 WordPress 视频具有响应能力。

We hope that you found this article useful. For feedback and questions please feel free to leave a comment below or join us on 推特 and 谷歌+.

我们希望您觉得本文有用。 有关反馈和问题,请随时在下面发表评论,或在推特谷歌+上加入我们。

翻译自: https://www.wpbeginner.com/plugins/how-to-make-your-videos-responsive-in-wordpress-with-fitvids/

wordpress响应缓慢

. . .

相关推荐

额外说明

Spring学习详细笔记(持续改进...)

概述 SSM框架是目前常用的框架,那框架是什么勒,简单来说,框架就是别人已经写好的软件,已经写好了模板,简化我们开发。后续我们如果需要进行其他开发,只需要进行一些增加删除。 SSM框架分别为: Spring:service处理框架,主要进行创建对象以及进

额外说明

七夕节代码表白

七夕节代码表白 记录一起走过的那些日子 创意代码表白 博主 默语带您 Go to New World. ✍ 个人主页—— 默语 的博客-- 《java 面试题大全》 -惟余辈才疏学浅,临摹之作或有不妥之处,还请读者海涵指正。☕- 《MYSQL从入门到精通

额外说明

Linux环境搭建SVN服务器并实现公网访问 - cpolar端口映射

文章目录 前言 1. Ubuntu安装SVN服务 2. 修改配置文件 2.1 修改svnserve.conf文件 2.2 修改passwd文件 2.3 修改authz文件 3. 启动svn服务 4. 内网穿透 4.1 安装cpolar内网穿透 4.2 创

额外说明

kubernetes使用local volume

local volume简介 参考:https://kubernetes.io/docs/concepts/storage/volumes/#local local volume指的是所挂载的某个本地存储设备,例如磁盘、分区或者目录。local volu

额外说明

逆波兰表达式求值(栈)

stoi()     参考    http://t.csdn.cn/L8DMQ  原题逆波兰表达式求值_牛客题霸_牛客网 (nowcoder.com) class Solution { public: int evalRPN(vector<str

额外说明

jackson-databind 简介、中文文档、中英对照文档 下载

jackson-databind 文档 下载链接(含jar包、源码、pom) 组件名称 中文-文档-下载链接 中英对照-文档-下载链接 jackson-databind-2.10.0.jar jackson-databind-2.10.0-API文档-中

额外说明

C++类和对象(下)

目录 一.初始化列表  二.explicit关键字 三.匿名对象 四. Static成员 五. 友元 六. 内部类 七.拷贝对象时的一些编译器优化 类和对象的语法的重难点已经学完了,然后还剩一点知识点收尾。 一.初始化列表         初始化列表存在

额外说明

小白白也能学会的 PyQt 教程 —— 自定义组件 Switch Button

文章目录 前言 思路讲解 代码部分 前言 最近在搞 Python 课程设计,想要搞一个好看的 UI,惊艳全班所有人。但打开 Qt Creator,Win7 风格的复古的按钮是在让我难以下手。 其次,我因为想要打造一个 Fluent UI 样式的设置页面,

额外说明

java 排除法定节假日以及正常周六日,计算两个Date相差的小时数

计算两个Date类型参数,相差的小时数。 如果不排除节假日周六日的话,处理起来非常easy,但是…如果要排除法定节假日,排除正常周六日,同时特殊支持法定的工作日(有一些周六日,国家强制正常上班),那么处理起来就非常麻烦,下面用基础的Date和Calend

额外说明

vue3中setup语法糖那些事儿

vue3中setup语法糖那些事儿 什么是语法糖? vue3相比于vue2有什么新的语法糖? ref reactive watch 生命周期 Teleport setup语法糖 `<script setup>`与传统vue3有何不同 传统vue3和set

ads via 小工具