[wordpress插件] Advanced Custom Fields: Image Size Select Field高级自定义字段:图像大小选择字段

wordpress 插件 文章 2020-01-26 21:20 541 0 全屏看文

AI助手支持GPT4.0

评分

100

100

描述

Field to select registered image sizes within the WordPress dashboard.

用于在WordPress仪表板中选择注册图像大小的字段。

Compatibility

兼容性

This ACF field type is compatible with:

此ACF字段类型兼容:

* ACF 5

* ACF 5

How to Use

使用方法

Once activated, this plugin will create a Image Size field type in ACF.

激活后,此插件将在ACF中创建一个图像大小字段类型。

This field type will list all registered field types as a drop down within the field group.

此字段类型将在字段组中作为下拉列表列出所有已注册的字段类型。

To use this field within your custom templates you will use the following code:

要在自定义模板中使用此字段,您将使用以下代码:

$my_image_id   = get_field('my_image_id');

  $ my_image_id = get_field('my_image_id'); 

// ACF Image return type set to ID for this demo

//此演示的ACF图片返回类型设置为ID

$my_image_size = get_field('my_image_size');

$ my_image_size = get_field('my_image_size');

// The selected image size (eg. large)

//所选的图片尺寸(例如大)

echo wp_get_attachment_image( $my_image_id, $my_image_size );

回声wp_get_attachment_image($ my_image_id,$ my_image_size);

// Output the image based on the ID, and the Image Size selected.

//根据ID和选择的图像尺寸输出图像。

安装步骤

    1. Copy the acf-image-size-select folder into your wp-content/plugins folder
    2. acf-image-size-select 文件夹复制到您的 wp-content / plugins 文件夹中

    3. Activate the Image Size Select plugin via the plugins admin page
    4. 通过插件管理页面激活“图像大小选择”插件

    5. Create a new field via ACF and select the Image Size Select type
    6. 通过ACF创建新字段,然后选择“图像尺寸选择”类型

下载地址

https://downloads.wordpress.org/plugin/acf-image-size-select.zip

https://downloads.wordpress.org/plugin/acf-image-size-select.zip

-EOF-

AI助手支持GPT4.0