Reputation: 21
Does anyone know a way to implement an iframe on a WordPress website. Every time I place the code onto the correct page, wordpress strips my code and the iframe breaks.
I was wondering if there was a plugin that allows iframe code to stay intact or if there is some form of shortcode to use.
I have tried: [iframe url="http://www.youtube.com/embed/X3kLPtVjjhA" width="579" height="360"] [fixiframe url="http://www.youtube.com/embed/X3kLPtVjjhA" width="579" height="360"] and installed the "embed iframe" plug-in on my site but none of them seem to work.
I appreciate the help.
Upvotes: 0
Views: 775
Reputation: 8869
Why are you using an iframe
to load a Youtube video, you should use the embed
tag that they show under the video...
I have iframes in my wordpress for all the Facebook/twitter buttons and they work great!
Upvotes: 0
Reputation: 6520
You don't need an iframe to post a youtube video, but to answer your questions about iframes in wordpess..
I am not sure what those plugins do. You can create page templates and have iframes in your pages without using any plugins.
Create a new page template and add the iframe in the php code for that page template. More specifically, create a copy of page.php and rename it. In the comments at the beginning of the file, edit the line with the template file name to Template Name: MyPage
. Edit the page code and add iframe code where you need it. And select this template (MyPage) as the template for your page in page edit section wp-admin.
You can also add the embed code as meta information to page in wp-admin, and fetch this meta information in the code to display the iframe. In this way, you can use different iframes for different pages with a single template.
Let me know if you need help with this. I will post a complete solution
Upvotes: 0