[wordpress插件] Custom CSS and JS自定义CSS和JS

wordpress 插件 文章 2020-04-07 19:00 483 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

Custom CSS and JS allows you to add stylesheets and JavaScripts to any

自定义CSS和JS 允许您将样式表和JavaScript添加到任何

individual post by adding custom fields.

通过添加自定义字段的单个帖子。

Both CSS and scripts can be either internal or external.

CSS和脚本都可以是内部的或外部的。

Since this is a plugin, the custom CSS and JavaScript are available to any theme used to display the post, as long as the themes call “wp_head”.

由于这是一个插件,因此自定义CSS和JavaScript可以用于显示帖子的任何主题,只要主题称为“ wp_head”即可。

Using the Plugin

使用插件

To use the plugin, add any combination of the following custom fields to your post.

要使用该插件,请将以下自定义字段的任意组合添加到您的帖子中。

custom_css

custom_css

Add an external stylesheet by adding a custom field with the name custom_css.

通过添加名称为 custom_css 的自定义字段来添加外部样式表。

The value of the field should be the path to your css file.

该字段的值应该是您的CSS文件的路径。

cusrom_css_code

cusrom_css_code

Add an internal stylesheet by adding a custom field with the name custom_css_code.

通过添加名称为 custom_css_code 的自定义字段来添加内部样式表。

Include your CSS code as the value.

包括您的CSS代码作为值。

(Do not include the style tags.)

(不包括样式标签。)

custom_js

custom_js

Add an external JavaScript by adding a custom field with the name custom_js.

通过添加名称为 custom_js 的自定义字段来添加外部JavaScript。

The value of the field should be the path to your script.

该字段的值应该是脚本的路径。

custom_js_code

custom_js_code

Add an internal JavaScript by adding a custom field with the name custom_js_code.

通过添加名称为 custom_js_code 的自定义字段来添加内部JavaScript。

Include your JavaScript code as the value.

包括您的JavaScript代码作为值。

(Do not include the script tags.)

(不包括脚本标签。)

Custom Fields Order

自定义字段顺序

    1. The external styles and scripts are included before the internal ones.
    2. 外部样式和脚本先于内部样式和脚本。

    3. If you include multiple entries for a given field, the entries will be included in order.
    4. 如果您在给定字段中包含多个条目,则这些条目将按顺序包含。

    Okay, but what if I don’t like those tags?

    好的,但是如果我不喜欢那些标签怎么办?

    Just edit custom-css-js.php and change the constants defined near the top of the file.

    只需编辑custom-css-js.php并更改文件顶部附近定义的常量。

    Note

    注意

    This plugin only works with individual posts and pages.

    此插件仅适用于单个帖子和页面。

    It does not work for list pages (e.g., the index page, search results).

    不适用于列表页面(例如索引页面,搜索结果)。

安装步骤

    1. Unpack the download package.
    2. 解压缩下载包。

    3. Upload folder to the “/wp-content/plugins/” directory
    4. 将文件夹上传到“ / wp-content / plugins /”目录

    5. Activate the plugin through the “Plugins” menu in WordPress
    6. 通过WordPress中的“插件”菜单激活插件

下载地址
https://downloads.wordpress.org/plugin/custom-css-and-js.zip
-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
[wordpress插件] Change WooCommerce Price Title更改WooCommerce价格标题
[wordpress插件] 404Editor404编辑器
[wordpress插件] Clickx Analytics- Free Marketing Plugin for WordPressClickx Analytics-适用于WordPress的免费营销插件
[wordpress插件] Custom 404 Error Page: Unilimited designs and colors自定义404错误页面:无限制的设计和颜色
[wordpress插件] Boxich – Keep visitors on your website longerBoxich –延长网站访问者的时间
随便看看
企业微信通讯录账号被管理员误/恶意删除,怎么办? 8048
问题? 7274
如何快速搭建抽奖助手小程序(无需代码知识) 5057
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 6012
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 5525
我的小程序广告收款主体是个体工商户,每个月邮寄两次发票很是麻烦,我年底的时候打包邮寄一次可以么? 5220
如何解决渲染层网络错误Failed to load media? 16570
小程序找号找回 释放昵称? 2431
我的小程序广告主收入5301,实际进账4406,是怎么回事呀? 2512
删除部分微信用户个人数据的通知,怎么删除? 5561