plugin-icon

ACF Timber Integration

作者:Dream Production·
Automatically enables in the Timber twig context variable all user-defined advanced custom fields.
评级
5/5
版本
1.4.0
活跃安装
300
最后更新
Feb 10, 2021
ACF Timber Integration

This plugin is intended for developers that are using Advanced Custom Fields and Timber to develop their themes.

By enabling this plugin the user-defined advanced custom fields will be available in the Timber context variable as follows:

  • Fields defined for settings pages will be available everywhere under the “options” key
  • Fields defined for posts, pages and custom post types will be available on the \Timber\Post object under the “fields” key
  • Fields defined for terms will be available on the \Timber\Term object under the “fields” key
  • Fields defined for users will be available on the \Timber\User object under the “fields” key

  • Defined menus will also be available everywhere under the “menus” key

Also adds twig functions for images:

  • srcset – used to generate srcset attribute tag. Usage: <img src="{{ post.thumbnail.src('large') }}" {{ srcset(post.thumbnail,'large') }} />
  • image_attr – used to generate srcset, width, height and alt. Usage: <img src="{{ post.thumbnail.src('large') }}" {{ image_attr(post.thumbnail,'large') }} />
免费使用Business套餐
通过安装,您同意 WordPress.com 服务条款第三方插件条款
目前已测试版本
WordPress 5.6.16
这个插件是可用的下载,适用于您的站点。