'YOUR_APP_KEY', 'apiSecret' => 'YOUR_APP_SECRET', 'apiCallback' => 'YOUR_APP_CALLBACK' )); $result = $instagram->getPopularMedia(); foreach ($result->data as $media) { $content = "
  • "; // output media if ($media->type === 'video') { // video $poster = $media->images->low_resolution->url; $source = $media->videos->standard_resolution->url; $content .= ''; } else { // image $image = $media->images->low_resolution->url; $content .= ''; } // create meta section $avatar = $media->user->profile_picture; $username = $media->user->username; $comment = (!empty($media->caption->text)) ? $media->caption->text : ''; $content .= '

    ' . $username . '

    ' . $comment . '
    '; // output media echo $content . "
  • "; } ?>