plugins - Import Instagram post to Wordpress blog post

I'm looking for a way how I can import an Instagram post to a Wordpress post. So to make it clear: I'm NOT loo

I'm looking for a way how I can import an Instagram post to a Wordpress post.

So to make it clear: I'm NOT looking for a Instagram Feed plugin. I need to import an Instagram post to a Wordpress blog posts separately.

This is because I need a post loop with multiple categories where one of them is an Instagram post.

So how can I do that? If there is a plugin for this, that will be fine. All suggestions are welcome. I prefer the most simple solution obviously.

Thanks in advance.

I'm looking for a way how I can import an Instagram post to a Wordpress post.

So to make it clear: I'm NOT looking for a Instagram Feed plugin. I need to import an Instagram post to a Wordpress blog posts separately.

This is because I need a post loop with multiple categories where one of them is an Instagram post.

So how can I do that? If there is a plugin for this, that will be fine. All suggestions are welcome. I prefer the most simple solution obviously.

Thanks in advance.

Share Improve this question asked Sep 30, 2019 at 10:59 Thomas TrompThomas Tromp 31 silver badge3 bronze badges 1
  • You need anyway to create an Instagram application for that and build a small API interface. – middlelady Commented Sep 30, 2019 at 11:29
Add a comment  | 

1 Answer 1

Reset to default 2

I'm not currently aware of other ways rather then:

  • Creating an Instagram App
  • Get an access token
  • Build a small API handler

Something like this to put in your functions.php:

function my_instagram()
{
    $transient_key = 'instagram_data';
    $feed_data = get_transient( $transient_key );
    if( false === $feed_data ) {
        $feed_data = json_decode(file_get_contents('https://api.instagram/v1/users/self/media/recent/?access_token=<ACCESS_TOKEN>&count=4'));
        if ( is_array( $feed_data->data ) ) {
            set_transient( $transient_key, $feed_data->data, 60*60*24 );
        }
    }
    return $feed_data;
}

Later of course you can manipulate your $feed_data as you need. Adjust the transient according to your requirements.

It's called feed because it is what it is. I'm afraid though they lately restricted the endpoints. Read more https://www.instagram/developer/endpoints/.

You can generate intagram access tokens here https://instagram.pixelunion/.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745119071a4612308.html

相关推荐

  • plugins - Import Instagram post to Wordpress blog post

    I'm looking for a way how I can import an Instagram post to a Wordpress post. So to make it clear: I'm NOT loo

    8小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信