Struggleville Forum
Embed Instagram Post In Forum Post - Printable Version

+- Struggleville Forum (https://struggleville.net/forum)
+-- Forum: Help! (https://struggleville.net/forum/forum-14.html)
+--- Forum: Forum Help & How To (https://struggleville.net/forum/forum-15.html)
+--- Thread: Embed Instagram Post In Forum Post (/thread-6.html)



Embed Instagram Post In Forum Post - PJ - 05-20-2020

I've been working on creating a custom code so that Instagram posts can be embedded in a post here if someone wanted to share it.  I believe the code is now working.  You would enter 
Code:
[insta]https://www.instagram.com/p/CAOqOgUhKBU/[/insta]


The tag is EXTREMELY picky.  After you have the tags and URL in place you need to highlight the URL and click the "unlink" button above, it looks like a broken chain.  Preview your post.  If it STILL isn't working then highlight the entire line and click the "Remove formatting" button above, it looks like an "A" with a red circle in the corner.

Here is what the output is from the insta tag:




Note:  If anyone ever comes across this that is running their own MyBB forum.  To get this code to work you need to create a Custom MyCode.  For regular expression put: 
Code:
\[insta\]https://www.instagram.com/p/(.*?)/\[/insta\]


For replacement put:
Code:
<iframe src="//instagram.com/p/$1/embed/captioned/" width="612" height="710" frameborder="0" scrolling="auto" allowtransparency="true" style="border: 1px #b2a998 solid; border-radius: 5px; box-shadow: 0px 0px 7px 0px rgba(106, 101, 91, 0.5); "
></iframe>