@Mega If i want the newly embeded link to show up I can't simply just embed it in the post. Although the embed should work it shows nothing (Twitter one works well, but Instagram and Facebook need a page reload every time just to display something) If you go back and then revist the link , nothing appears, but you can reload again and it appears. (if you get me)
The page will need a reload every time, thus I have added to the start of the embed code some javascript to reload the page every time the embed page is opened.
embed = '<script><!-- $(document).ready(function(){if(document.URL.indexOf("#")==-1){url=document.URL+"#";location="#";location.reload(true);}});//--></script><div class="fb-post" data-href="https://www.facebook.com/$1/posts/$2" data-width="500"></div>';
Code that will reload the embed everytime the page is loaded:
<script><!-- $(document).ready(function(){if(document.URL.indexOf("#")==-1){url=document.URL+"#";location="#";location.reload(true);}});//--></script>
Div facebook post will embed/show in:
<div class="fb-post" data-href="https://www.facebook.com/$1/posts/$2" data-width="500"></div>';
There's also some code I put in after the <body> in the header.tpl of lavender theme
<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0"; fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script>
If there is a better way to do this please advise