Private posts in WP 1.2 aren't displayed even to the user who created them. This may already have been patched in versions of WordPress > 1.2, but I haven't upgraded yet.

Only one file needs to be changed: wp-blog.header.php

  1. Do a search for "// Category stuff" without the quotes
  2. Copy and paste the following ABOVE "// Category stuff":
    // Check if the user is logged-in - KT 24122004
      if((!empty($_COOKIE['wordpressuser_'.$cookiehash])) && 
    (!empty($_COOKIE['wordpresspass_'.$cookiehash]))) {
        $user_login = $_COOKIE['wordpressuser_'.$cookiehash];
        $user_pass_md5 = $_COOKIE['wordpresspass_'.$cookiehash];
      }
      function checklogin() {
        global $user_login, $user_pass_md5, $user_ID;
        $userdata = get_userdatabylogin($user_login);
        if ($user_pass_md5 != md5($userdata->user_pass)) {
          return false;
        } else {
         $user_ID = $userdata->ID;
          return true;
        }
      } 
      checklogin();
    
  3. That's it! Private posts will now be displayed. If you'd like some kind of indication that the post is a private one, edit index.php and insert something like

    < ?php if ('private' == $post->post_status) _e(' - Private'); ?>

    into the region where the post is displayed.

  4. What's basically happening is a check is done if the login cookie exists, and if so, ensure the username and password is valid, before setting $user_ID which is used later on to retrieve private posts. I could have also modified the login code to include the user_id in the cookie, but didn't think that was as secure as this approach, though this incurs an additional database hit to perform the login check.