[wordpress插件] WordPress HTMLWordPress HTML

wordpress 插件 文章 2020-04-08 10:50 408 0 全屏看文

AI助手支持GPT4.0

评分
94
描述

WordPress HTML allows you to add custom HTML to both the post/page BODY and the HEAD tags from the page editor.

WordPress HTML允许您将自定义HTML添加到页面编辑器中的帖子/页面 BODY HEAD 标记中。

When copying HTML into the WordPress editor it adds spurious tags which break various elements and corrupt the HTML.

将HTML复制到WordPress编辑器中时,会添加伪造的标签,这些标签会破坏各种元素并破坏HTML。

By saving the HTML in the custom fields dialogue the exact HTML will be output to your post/page.

通过将HTML保存在自定义字段对话框中,确切的HTML将输出到您的帖子/页面。

Also if you have a single page which requires an extra javascript library or style sheet you normally have to add it through your themes php files.

如果您只有一个页面,需要一个额外的javascript库或样式表,则通常必须通过主题php文件将其添加。

Updating the theme files can be a pain;

更新主题文件可能会很痛苦。

we normally have to set up an exception for that individual page and load it there.

我们通常必须为该单个页面设置一个异常并将其加载到该页面。

As this information is not available when we are editing the actual pages in the WordPress editor it is quite obstructive.

当我们在WordPress编辑器中编辑实际页面时,由于此信息不可用,因此非常麻烦。

With WordPress HTML, we can add the library or stylesheet directly to the post/page head without the need to change the theme files.

使用WordPress HTML,我们可以将库或样式表直接添加到帖子/页面标题,而无需更改主题文件。

And importantly, all from within the WordPress editor for that page.

而且重要的是,所有操作均来自该页面的WordPress编辑器。

Example libraries:

示例库:

jQuery, ChartJS, D3js, Highcharts, Prototype

jQuery,ChartJS,D3js,Highcharts,Prototype

More details: WordPress HTML

更多详细信息: WordPress HTML

Code: GitHub

代码: GitHub

安装步骤

Upload the plugin to your blog and activate it.

将插件上传到您的博客并激活它。

In the post/page which needs HTML add a custom field with name: “body”, paste the HTML into the value box, then insert the shortcode [body][/body] where it should appear in the page.

在需要HTML的帖子/页面中,添加一个名称为“ body”的自定义字段,将HTML粘贴到值框中,然后在页面中应显示的短代码[body] [/ body]中插入该代码。

You can insert multiple body tags with the syntax: [body id=”element1″][/body], where “element1” is the name of a custom field to insert.

您可以使用以下语法插入多个正文标签:[body id =” element1”] [/ body],其中“ element1”是要插入的自定义字段的名称。

To add to the HTML head tag, add a custom field with name: “head” and paste the HTML into the value box.

要添加到HTML head标签,请添加一个名称为“ head”的自定义字段,并将HTML粘贴到值框中。

Adding a Custom Field:

添加自定义字段:

To add a custom field, scroll down in the editor to Custom Fields.

要添加自定义字段,请在编辑器中向下滚动到“自定义字段”。

There is an option underneath the dropdown to “Enter New”.

下拉菜单下方有一个选项“ Enter New”。

Click that, type in “head” or “body”, and then click “Add Custom Field”.

单击该名称,键入“ head”或“ body”,然后单击“ Add Custom Field”。

This is shown in the screenshots.

在屏幕截图中显示。

下载地址
https://downloads.wordpress.org/plugin/custom-html-bodyhead.zip
-EOF-

AI助手支持GPT4.0