gil hamer gil hamer - 1 year ago 85
PHP Question

Display single latest instagram photo on your website

I am looking all over the web and can't believe I can't find an answer to my question.
I would like to display the latest single instagram photo on my website. simple as that.

No gallery, no fancybox, no slideshow etc etc

I found this useful link:

it's actually working but it doesn't give an option of how many images you would like to display
and I would like only one latest instagram image.

anyone have an idea?


Answer Source

You can break foreach after showing first image like below:

foreach ($result->data as $post) {
  // Do something with this data.
  break; // for one result only

Or add &count=1 at end of url as below
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download