ryangittings / craft-instagram-feed
一个简单的插件,用于在模板中提取Instagram帖子。
1.0.2
2018-01-19 10:17 UTC
Requires
- craftcms/cms: ^3.0.0-RC1
This package is auto-updated.
Last update: 2024-09-14 22:41:25 UTC
README
一个Craft CMS插件,允许您检索Instagram流。
安装
将instagramfeed/目录上传到您的plugins/目录。
转到插件并安装/启用Instagram Feed。
接下来,转到设置并输入您的Instagram用户ID和访问令牌。
用法
instagramfeed提供了两种可调用的方法。
getFeed(int $numberOfPostsToRetrieve)
返回一个包含您的Instagram帖子的多维数组。每个帖子都有四个可以访问的元素。
- link (您的Instagram帖子的链接)
- url (图片的URL)
- likes (帖子收到的点赞数)
- comments (帖子收到的评论数)
{% for image in craft.instagramfeed.getFeed(8) %}
{{ image.link }}
{{ image.url }}
{{ image.likes }}
{{ image.comments }}
{% endfor %}
isConnected()
如果Instagram Feed成功连接到您的Instagram账户,则返回true