Add Social Media Embed code to your article

1. From the Blog Studio editor, select the  Advanced selection from the Content Blocks list. 

2. Drag and drop the < code snippet > content block onto your article. 

3. Click on the < code snippet > block on the editor, and then on the gear icon, the second out of the four icons. 

4. You'll see the code editor display. By default, there will be some placeholder code in the box

  Replace it with the following

<div class="studio-instagram-embed" style="max-width: 658px;">
    <div data-aspect-ratio="1:1">
        <!-- instagram embed here -->
    </div>
    <script>
      (function($) {
        $('.studio-instagram-embed').each(function() {
          var $target = $(this);
          if ($target.data('height-watching')) {
            return;
          }
          $target.data('height-watching', true);
          $target.bind('DOMSubtreeModified', function(e) {
            setTimeout(function() {
              if ($target.data('height-done')) {
                return;
              }
              var $iframe = $target.find('iframe').first();
              if (!$iframe) {
                return;
              }
              $iframe
              var height = parseInt($iframe.attr('height'));
              var width = parseInt($iframe.width());
              if (!height || !width || isNaN(height) || isNaN(width)) {
                return;
              }
              $iframe.css({
                'min-height': '100%',
                'position': 'absolute',
                'top': '0',
              });
              $target.data('height-done', true);
              $target.children('[data-aspect-ratio]').css('padding-top', 'calc(100% + ' + (height - width) + 'px)');
            }, 50);
          });
        });
      }(jQuery));
    </script>
</div>

5. Once you've pasted your code, add the embed code from Instagram ( Here's how to access Instagram embed code:  https://help.instagram.com/513918941996087) to replace the 3rd line in the snippet, then click  Save.

6. Click on  Save Changes at the top right corner. 

7. Here is an example of an embed Instagram post in Blog article:

Still need help? Contact Us Contact Us