I don't even know if this is possible and my search terms in google are not doing any good.

Since the site URL and blog URL are different I had to fix the post preview bug by giving wordpress it's own directory. Problem is, the site is being updated in pieces so it's part wordpress, part old school html, including the site homepage wich is still index.html.

I'm trying to work out a way to make it index.php and detect if the request is coming from a preview query. If so it will serve up the code to redirect to the preview page. If not it will serve up the standard homepage code.

If possible, how would one go about doing this? I have no idea where to even start looking.

-- EDIT --

Thanks to s_ha_dum, here is the solution to fixing post previews not working when your site and blog urls are different.

  1. Follow these instructions

  2. Replace your site index file with index.php containing the following code

    if (isset($_GET['preview']) && 'true' == $_GET['preview']) {
        define('WP_USE_THEMES', true);
    } else {
        header('Location: /home/');

It is going to be hard to give a solid answer without knowing exactly how you've cobbled things together but a preview always has preview=true in the URL. Just check that.

if (isset($_GET['preview']) && 'true' == $_GET['preview']) {
    // send the page to WordPress
} else {
    // load index.html  I guess ?
| improve this answer | |
  • Perfect! I linked it to the old index file with require ('/home/index.html');. I'll put the final code in my question for anyone else with this problem. – kristina childs Dec 6 '12 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.