Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

    <?php
    
    if (isset($_GET['preview']) && 'true' == $_GET['preview']) {
    
        define('WP_USE_THEMES', true);
    
        require('./wp/wp-blog-header.php');
    
    } else {
    
        header('Location: /home/');
    
    }
    ?>
    
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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 ?
}
share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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