Ejemplo n.º 1
0
<?php

// Get instagram feed
$instagram_feed = get_instagram_feed(IGV_get_option('_igv_instagram_handle'));
if ($instagram_feed) {
    ?>

<section id="instagram-feed" class="theme-grad-bg hide-on-mobile">
  <div class="container">
    <div class="row">

  <?php 
    foreach ($instagram_feed as $index => $instagram_item) {
        $likes = $instagram_item->likes->count;
        $comments = $instagram_item->comments->count;
        $img = $instagram_item->images->low_resolution->url;
        $hi_res_img = $instagram_item->images->standard_resolution->url;
        $caption = $instagram_item->caption->text;
        ?>

  <?php 
        if ($index != 0) {
            ?>
      <div class="col s1">&#8200;</div>
  <?php 
        }
        ?>

      <div class="instagram-item col s4">
        <a href="<?php 
        echo $instagram_item->link;
Ejemplo n.º 2
0
<footer class="content-info">
  <div class="container">
    <div class="row">
      <div class="col-lg-5 col-md-6 col-sm-12 col-xs-12">
        <h4>Join the conversation every day</h4>
        <p><?php 
the_field('instagram_blurb', 'option');
?>
</p>
        <div class="row instagram">
          <?php 
//Retrieve cached result from functions.php transient cache
$feed = get_instagram_feed();
$counter = 0;
if (!empty($feed)) {
    foreach ($feed['data'] as $post) {
        $pic_link = $post['link'];
        $pic_src = str_replace("http://", "https://", $post['images']['standard_resolution']['url']);
        if ($counter > 3) {
            echo "<div class='col-md-2 col-sm-3 col-xs-3 item_box overflow'>";
        } else {
            echo "<div class='col-md-2 col-sm-3 col-xs-3 item_box'>";
        }
        echo "<a href='{$pic_link}' target='_blank'>";
        echo "<img class='img-responsive photo-thumb' src='{$pic_src}' alt='{$pic_text}'>";
        echo "</a>";
        echo "</div>";
        $counter++;
    }
}
?>