Re-Enable Wordpress Post Preview

By Josh | February 13, 2008

I remember back when I first started blogging there was this feature in Wordpress that allowed you to preview a post that you were writing, right below the editor. I always wondered what happened to it. Opening another tab or window to preview my post can get annoying after a while. So I went out and found a way to re-enable the post preview option.

  1. First, go into your wp-admin folder and open up your post.php file.
  2. Then go down to the line that contains the code below. It was at line 72 for me, but it may be a little different for you.

    include('edit-form-advanced.php');

  3. Underneath that line of code, insert the following:

    ?>
    <div id='preview' class='wrap'>
    <h2 id="preview-post"><?php _e('Post Preview (updated when post is saved)'); ?></h2>
    <iframe src="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe>
    </div>
    <?php

  4. Save your post.php file.

Now, give it a try. I tested it on the latest version of Wordpress (2.3.3) and it works great. When you get done writing a post and you want to preview it, just click the Save and Continue Editing button, then scroll down to the bottom of the Write Post page and you’ll see the preview.

Thanks to WorkingAtHomeInternet.com.

Topics: Internet | Comments

What I'm Doing...

Posting tweet...

Powered by Twitter Tools.

Interesting Links