[wordpress插件] Display Custom Fields显示自定义字段

wordpress 插件 文章 2020-04-19 09:21 491 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

This plugin allows you to display the value of a custom field on a page or post.

此插件可让您在页面或帖子上显示自定义字段的值。

Permitted values are raw text, html, javascript, javascript file url, css, css file.

允许的值为原始文本,html,javascript,javascript文件url,css,css文件。

Since version 1.1.x it also allows you to show a custom field of any page or post, provided you have the id.

从1.1.x版开始,如果您具有ID,它还允许您显示任何页面或帖子的自定义字段。

One of the intended use of this plugin is to provide just in time code without editing the theme.

此插件的预期用途之一是提供及时的代码,而无需编辑主题。

Often code, especially css, gets lost with theme change.

通常,代码(尤其是CSS)会因主题更改而丢失。

This techniques will ensure the values are loaded only on the given page and they will survive changes of themes and other plugins.

这种技术将确保仅在给定页面上加载这些值,并且它们将在主题和其他插件的更改中幸免。

You can also use this to include javascript snippets or files.

您还可以使用它来包含javascript代码段或文件。

They will only be loaded on the given post or page.

它们只会加载到给定的帖子或页面上。

This in turn allows for loading of scripts only where needed.

反过来,这仅允许在需要的地方加载脚本。

You may use the plugin in two ways:

您可以通过两种方式使用该插件:

[dcf field=”name_of_custom_field”]

[dcf field =” name_of_custom_field””

or optionally you can

或者可以选择

– define the type of the field value.

–定义字段值的类型。

By default the type is “raw”.

默认情况下,类型为“原始”。

– provide the id number of the page or post.

–提供页面或帖子的ID号。

By default, it would be the current page/post id.

默认情况下,它是当前页面/帖子的ID。

[dcf field=”name_of_custom_field” type=”value_type” id=’post_or_page_id_number’]

[dcf field =” name_of_custom_field” type =” value_type” id =” post_or_page_id_number”]

The accepted value types are:

可接受的值类型为:

“raw” – this is the default and you do not need to specify this type.

“原始”-这是默认设置,您无需指定此类型。

It outputs the value as it is.

它按原样输出值。

You can use html code in the values quite safely.

您可以非常安全地在值中使用html代码。

“js” – use this to specify that the value is actually javascript.

“ js” –使用它来指定该值实际上是javascript。

Do not wrap it with the script tag.

不要用script标签包装它。

Remember that $ is not a valid jQuery replacement in WordPress.

请记住,$不是WordPress中有效的jQuery替代品。

You should use “jQuery” instead.

您应该改用“ jQuery”。

“jsf” – You may need to include a javascript file.

“ jsf” –您可能需要包含一个javascript文件。

The value of the custom field should be a fully qualified javascript file url.

自定义字段的值应为标准的javascript文件url。

“css” – use this to specify css code in the value of the custom field.

“ css” –使用它在自定义字段的值中指定CSS代码。

“cssf” – You may need to include a css file.

“ cssf” –您可能需要包括一个css文件。

The value of the custom field should be a fully qualified css file url.

自定义字段的值应为完全限定的css文件url。

Here I would like to note that:

在此我要指出:

– It is highly unusual to include css files in the body.

–在体内包含css文件是非常不寻常的。

However, it does work.

但是,它确实有效。

– There may be a side effect that some elements may not show properly until the css file is completely loaded.

–可能会有副作用,直到完全加载css文件,某些元素可能无法正确显示。

安装步骤

The installation has no special requirements.

安装没有特殊要求。

Proceed as normal.

照常进行。

Upload the display-custom-fields folder to the /wp-content/plugins/ directory

将display-custom-fields文件夹上载到/ wp-content / plugins /目录

Alternatively use the upload plugin installable zip

或者使用上传插件可安装的zip

Activate the plugin through the \’Plugins\’ menu in WordPress

通过WordPress中的“插件”菜单激活插件

There are no settings in the normal version.

普通版本中没有设置。

The pro version installs a additional security configuration in the menu.

专业版会在菜单中安装其他安全配置。

下载地址
https://downloads.wordpress.org/plugin/display-custom-fields.1.1.1.zip
-EOF-

AI助手支持GPT4.0