Feed on Posts or Comments

Blogs & Content Management Systems & Scripts & Tips and Tricks & WordPress Alan Hartung on 19 Dec 2008 07:31 pm

Use iframe in WordPress

With WordPress’s custom page templates, you can now get iframes to work in the body of your pages.

After searching the internet far and wide for an iframe solution for WordPress, I mostly found uppity comments about how it was not secure, and you just should not use them.


Well, sometimes there are good uses for the iframe. Such as using an iframe for Google Calendar, or if a client uses some other third-party calendar provider and get their content through the use of the html tag iframe.

Remembering what I had to do to extend WordPress to be a more full-featured content management system, I took my cue and created a new page template. You could call it “calendar.php.”

It is in the template where I just chose to place all of my code for that page and pulled the iframe in rather nicely.

I used a PHP include to bring in the actual html, but I’m pretty sure it will work just putting the iframe code directly into the template file (though I have not tested that).

So if you’ve been beating your head against the wall looking for a way to get an iframe into the body of a WordPress page, this is a simple solution. Though one that is more technical than you should have to be for a content management system.

Subscribe to the comments through RSS Feed

Leave a Reply