[wordpress插件] Advanced Custom Fields – Code Area Field高级自定义字段-代码区字段

wordpress 插件 文章 2020-02-07 03:20 624 0 全屏看文

AI助手支持GPT4.0

评分

82

82

描述

The ‘Code Area’ field allows you to add custom CSS, Javascript, HTML and PHP to an advanced custom field, whcih can be use anywhere in your wordpress template files.

“代码区域”字段允许您将自定义CSS,Javascript,HTML和PHP添加到高级自定义字段中,并且可以在您的wordpress模板文件中的任何位置使用。

The code area uses Code Mirror and has various themes to suit.

代码区域使用代码镜像,并具有各种适合的主题。

CSS

CSS

Type your css, no tags needed

输入您的CSS,不需要标签

Javascript

JavaScript

Type your Javascript, no tags needed

输入您的Javascript,不需要标签

PHP

PHP

Type your PHP, no tags needed (Note, you can not open and close php tags anywhere in your code)

键入您的PHP,不需要标签(请注意,您无法在代码中的任何位置打开和关闭php标签)

Output all types of code in the usual fashion the_field(‘code_area_field’);

以通常的方式输出所有类型的代码the_field(‘code_area_field’);

Compatible with both ACF V3 & V4

与ACF V3和V4兼容

安装步骤

This add-on can be treated as both a WP plugin and a theme include.

此附加组件可以被视为WP插件和主题包含。

Install as Plugin

安装为插件

Copy the ‘acf-code_area’ folder into your plugins folder

将“ acf-code_area”文件夹复制到您的插件文件夹中

Activate the plugin via the Plugins admin page

通过插件管理页面激活插件

Include within theme

包含在主题中

Copy the ‘acf-code_area’ folder into your theme folder (can use sub folders).

将“ acf-code_area”文件夹复制到您的主题文件夹中(可以使用子文件夹)。

You can place the folder anywhere inside the ‘wp-content’ directory

您可以将文件夹放置在“ wp-content”目录内的任何位置

Edit your functions.php file and add the code below (Make sure the path is correct to include the acf-cf7.php file)

编辑您的functions.php文件并添加以下代码(确保路径正确以包含acf-cf7.php文件)

add_action('acfegister_fields', 'my_register_fields');

  add_action('acf / register_fields','my_register_fields');

function my_register_fields()

函数my_register_fields()

{    

{    

include_once('acf_code_area-field/acf_code_area-v3.php');

include_once('acf_code_area-field / acf_code_area-v3.php');

}

}

下载地址

https://downloads.wordpress.org/plugin/advanced-custom-fields-code-area-field.1.0.1.zip

https://downloads.wordpress.org/plugin/advanced-custom-fields-code-area-field.1.0.1.zip

-EOF-

AI助手支持GPT4.0