开发者 |
dream-production
danieltelbis sticksu |
---|---|
更新时间 | 2021年2月10日 18:42 |
PHP版本: | 3.7 及以上 |
WordPress版本: | 5.6.1 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
<img src="{{ post.thumbnail.src('large') }}" {{ srcset(post.thumbnail,'large') }} />
<img src="{{ post.thumbnail.src('large') }}" {{ image_attr(post.thumbnail,'large') }} />
Because that's not a truly MVC approach. You can still use the get_field() function in twig, but it's easier for the frontend developer to have everything available directly in the context variable.
Timber does not transform Images, Galleries, Posts, Taxonomies or Users to the equivalent Timber Object when using get_field() or accessing the field directly in the post object. You will need to cast each of these in order to use them as Timber Objects without using our plugin.