kerigansolutions/instagram-autogallery-wp
最新稳定版本:1.2
Composer 安装命令:
composer require kerigansolutions/instagram-autogallery-wp
包简介
README 文档
README
Easily pull posts into your WordPress Site from an Instagram page lnked to a Facebook Business page that you manage. WordPress is required and a special Admin page in WordPress is created. Posts are fetched and added to the WP database using a cron that runs every hour.
Status
Currently the app is configured to work with Posts.
Installation
composer require kerigansolutions/fb-instagram-wp
Setup
- Make sure you have admin access to the FB page and it is linked to the Instagram page you need to sync.
- Log into WordPress and go to the new Instagram Settings menu item.
- Authorize the app using app secret (FYI only KMA knows this).
- Use the Auth tool to authorize the app to use a Facebook page you manage and select the Instagram feed.
- Use the sync tool to build the database of posts.
- Program a view to show the data in your templates.
Include or Extend the WP Admin class:
use KeriganSolutions\Instagram; use KeriganSolutions\Instagram\WP\InstagramPost; class Instagram extends Instagram\WP\Admin { // retrieve posts from WP database public function getInstagramPosts($num = -1, $args = []) { return (new InstagramPost())->query($num, $args); } }
Or make the API call and retrieve the results directly:
use KeriganSolutions\Instagram\WP\InstagramPost; $feed = new InstagramPost; $results = $feed->query(5);
fetch("/wp-json/kerigansolutions/v1/get-kma-instagram-post", { method: 'GET', mode: 'cors', cache: 'no-cache', headers: { 'Content-Type': 'application/json', }, }) .then(r => r.json()) .then((res) => { // do something with res })
统计信息
- 总下载量: 518
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-12