[wordpress插件] Advanced Custom Fields: Archive Templates高级自定义字段:存档模板

wordpress 插件 文章 2020-01-26 04:20 620 0 全屏看文

AI助手支持GPT4.0

评分

100

100

描述

ACF Archives is a little plugin for helping you attach ACF fields to the archive template.

ACF Archives是一个小插件,可帮助您将ACF字段附加到存档模板。

The plugin will add a submenu for each public custom post type with archive defined

该插件将为每种公共自定义帖子类型添加一个子菜单,其中定义了存档

and then you can select under ACF rules box.

然后您可以在“ ACF规则”框中选择。

Want to add or remove the submenu for other custom post types?

是否要添加或删除其他自定义帖子类型的子菜单?

Here is a code example you can add to to your theme functions.php

这是一个代码示例,您可以将其添加到主题函数中。php

    add_filter( 'acf_archive_post_types', 'change_acf_archive_cpt' );    

  add_filter('acf_archive_post_types','change_acf_archive_cpt');    

function change_acf_archive_cpt( $cpts ) {        

函数change_acf_archive_cpt($ cpts){        

// 'book' and 'movie' are the cpt key.        

//'book'和'movie'是cpt键。        

// Remove cpt        

//删除cpt        

unset( $cpts['book'] );        

unset($ cpts ['book']);        

// Add cpt        

//添加cpt        

$cpts['movie'] = Movies Archive;        

$ cpts ['movie'] =电影档案;        

return $cpts;    

返回$ cpts;    

}

}

Get the acf field on archive page

在存档页面上获取acf字段

    $object = get_queried_object();    

  $ object = get_queried_object();    

$field = get_field( 'field_name', $object->name );    

$ field = get_field('field_name',$ object-> name);    

var_dump( $field );

var_dump($ field);

From within WordPress

在WordPress内部

    1. Visit ‘Plugins > Add New’
    2. 访问“插件>添加新内容”

    3. Search for ‘acf archive’
    4. 搜索“ acf存档”

    5. Activate ACF Archive from your Plugins page.
    6. 从“插件”页面激活ACF存档。

    Manually

    手动

      1. Upload the acf-archive folder to the /wp-content/plugins/ directory
      2. acf-archive 文件夹上传到 / wp-content / plugins / 目录

      3. Activate the ACF Archive plugin through the ‘Plugins’ menu in WordPress
      4. 通过WordPress中的“插件”菜单激活ACF存档插件

下载地址

https://downloads.wordpress.org/plugin/acf-archive.1.0.5.zip

https://downloads.wordpress.org/plugin/acf-archive.1.0.5.zip

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
[wordpress插件] Application Insights Dashboard PluginApplication Insights仪表板插件
[wordpress插件] Advanced Custom Fields – Address Field add-on高级自定义字段–地址字段附加组件
[wordpress插件] BuddyPress Photos+tagsBuddyPress照片+标签
[wordpress插件] CDN ToolsCDN工具
[wordpress插件] AOS Animation for SiteOrigin Page Builder适用于SiteOrigin Page Builder的AOS动画
随便看看
如何查看小程序的html? 612
image不显示? 276
开发者工具设置基础库版本为2.21.2,但是获取手机号还是之前老接口的响应结果啊? 348
getphonenumber获取code? 360
message:Error: 代码包大小为 2222 kb,上限为 2048 kb,请删除文件后? 2445
微信小程序小白如何快速学会制作电商小程序? 334
为什么微信搜一搜突然搜不到自己的公众号文章了?之前都可以 351
app调起支付,返回该商户支付权限已被取消 411
企业付款到个人银行卡 已入驻满90天,30天有交易,但还是当前商户号暂时无法开通此功能? 387
分享到朋友圈、分享给朋友不正常,分享到QQ好友正常 380