WordPress.org

Ready to get started?Download WordPress

Forums

Using WordPress PHP in iFrame (8 posts)

  1. gazzanewpy
    Member
    Posted 8 years ago #

    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!

  2. Ellwangen
    Member
    Posted 8 years ago #

    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!

  3. gazzanewpy
    Member
    Posted 8 years ago #

    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.

  4. Ellwangen
    Member
    Posted 8 years ago #

    Sounds good that far. So the iframe itself works but the new site is not found? Is it in another folder?

  5. gazzanewpy
    Member
    Posted 8 years ago #

    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?

  6. chillbilly
    Member
    Posted 8 years ago #

    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">

  7. chillbilly
    Member
    Posted 8 years ago #

    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.

  8. gazzanewpy
    Member
    Posted 8 years ago #

    Got it working by using the full URL. Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags