Jump to content

wordpress insta iframe php


Jeisson

Recommended Posts

Hello

 

I have a strange issue. (or maybe not for you). In wordpress you can put instagram as iframes simply by writing the url on a separate line. That works fine. But I needed to get the url proglamaticly so I did a php code like the following

 <?php
echo '<iframe height="1250px" width="96%" frameborder="0" scrolling="no" src="', htmlspecialchars($_GET["insta"]), '">', '</iframe>';
?>

What it does is that it takes from the url the variable insta and puts that on the page as an iframe. ex. www.myblog.com/specialpage?insta=https://instagram.com/p/8JEjgAicX7/

 

So this doesent work. it gives an empty iframe, but if I only write that address in a wordpress post or page it do work.

 

However with the exact same code with /embed/ added do work. Problem is that does not show the captions and hashtags.

www.myblog.com/specialpage?insta=https://instagram.com/p/8JEjgAicX7/embed/   <-- this is working

 

I dont know if this a php-wordpress or what problem. but if you have a clue then your help is appreciated

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.