Title: Using WordPress PHP in iFrame
Last modified: August 18, 2016

---

# Using WordPress PHP in iFrame

 *  [gazzanewpy](https://wordpress.org/support/users/gazzanewpy/)
 * (@gazzanewpy)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/using-wordpress-php-in-iframe/)
 * I have created a site that is predominantly HTML with a few pages using iframes
   to keep the style consistent. I want to pull WordPress PHPs into the iFrame as
   well for the same reason. I have used the <iframe src=”index.php”> but alas nothing.
 * Any ideas where I could be going wrong?
 * Oh, I did include a meta that stated the refresh but all this did was after a
   fe seconds the whole page went white!

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [ellwangen](https://wordpress.org/support/users/ellwangen/)
 * (@ellwangen)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/using-wordpress-php-in-iframe/#post-350510)
 * Perhaps you forgot to close the tag.
    `<iframe src="index.php"></iframe>` I tested
   it without and it didn’t matter.
 * Which website is concerned? What exactly did you want to do with the meta refresh?
   Of course an iframe will disappear if the browser is overwriting the current 
   site with the one of the meta tag!
 *  Thread Starter [gazzanewpy](https://wordpress.org/support/users/gazzanewpy/)
 * (@gazzanewpy)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/using-wordpress-php-in-iframe/#post-350511)
 * Nope, closed the tags:
 * <iframe src=”index.php” scrolling=”auto” width=”700″ height=”300″ frameborder
   =”0″>
    I am sorry but either your browser does not support inline frames or you
   have this option disabled. </iframe>
 * But all I get is a big white rectangle in the middle of my page (where the iFrame
   is) and a notice telling me I am looking for something that is not there.
 *  [ellwangen](https://wordpress.org/support/users/ellwangen/)
 * (@ellwangen)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/using-wordpress-php-in-iframe/#post-350512)
 * Sounds good that far. So the iframe itself works but the new site is not found?
   Is it in another folder?
 *  Thread Starter [gazzanewpy](https://wordpress.org/support/users/gazzanewpy/)
 * (@gazzanewpy)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/using-wordpress-php-in-iframe/#post-350514)
 * Okay, yes I moved the files to the worpress root (rather than in the themes section
   where they were). I still get the white rectangle but I get this text now:
 * <?php
    /* Short and sweet */ define(‘WP_USE_THEMES’, true); require(‘./wp-blog-
   header.php’); ?>
 * why?
 *  [chillbilly](https://wordpress.org/support/users/chillbilly/)
 * (@chillbilly)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/using-wordpress-php-in-iframe/#post-350516)
 * put in the entire path to the index.php…I had the same problem the other day 
   when I was messin around with Iframes ta check out the effect.
 * Decided not to use the iframe becuase search engine indexers will pull content
   onto the results page with a link going to a page within the WP…when that link
   is followed the user ends up on the page, but the page is not in the iframe.
 * <iframe src=”[http://www.yoursite.com/WP/index.php”&gt](http://www.yoursite.com/WP/index.php”&gt);
 *  [chillbilly](https://wordpress.org/support/users/chillbilly/)
 * (@chillbilly)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/using-wordpress-php-in-iframe/#post-350523)
 * if your wonderin…I tryed a different set up thats more SE friendly…I didn’t finish
   it or test it, but I got the idea down.
 * I tryed useing just frames…it has the same problem of the user gettin linked 
   to a page, but outa the frames, but I have a javaScript that pulls the page and
   the user into the mainframe on the main page.
 * Problem then was the Jscript would need to be included on every page within the
   WP and each directory that has an index.php would also need a copy of the index.
   html frame set from the main page.
 * I don’t know too much about Jscript programing, but im betting someone can figure
   out how to not need the copy of the frame set in each directory.
 *  Thread Starter [gazzanewpy](https://wordpress.org/support/users/gazzanewpy/)
 * (@gazzanewpy)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/using-wordpress-php-in-iframe/#post-350534)
 * Got it working by using the full URL. Thanks

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Using WordPress PHP in iFrame’ is closed to new replies.

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 7 replies
 * 3 participants
 * Last reply from: [gazzanewpy](https://wordpress.org/support/users/gazzanewpy/)
 * Last activity: [20 years, 4 months ago](https://wordpress.org/support/topic/using-wordpress-php-in-iframe/#post-350534)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
