On the new WordPress 2.8 installation, I've some posts designated to category Foo which were formerly public but have since occurred private. After I am drenched into WordPress (because the admin) and occur to be also browsing the Foo category page inside a different tab within the same browser, I can tell the non-public posts around the category page, using the entry game titles prefixed through the word "PRIVATE: ".

Now, there is nothing "damaged" relating to this -- the posts are properly hidden from non-drenched-in customers. But I'm not going drenched-in customers to determine the non-public posts around the live site, because frankly it is simply annoying, not useful.

What must i do in order to the Wordpress Loop around the category archive page in order to the functions file to show off this undesirable capability to see private posts on the website?

Therefore if we're not to see these private posts, including admins, why don't you just set their status to unregistered or draft?

This isn't an immediate means to fix the precise question, only one method for you to hide individuals posts would be to assign these to a unique category, then hide that category from exhibiting informed. To exclude posts from the given category from display, within the loop (soon after the while() statement) make use of this type of code:

<?php if (in_category('3')) continue; ?>

Within this example, 3 may be the category ID from the category to exclude, and also the code simply informs WordPress to carry on onto the following publish without exhibiting that one.

The hack method of doing what you would like would be to put this type of code towards the top of your loop (following the the_publish() part:

if( get_post_status()=='private' ) continue;

This is actually the hack way since your WordPress continues to be loading that publish in the database and invoice discounting it directly into publish counts, etc, but missing it when likely to display it. Should you looked for any phrase which was only in private posts, you can get an empty page with no error, for instance.

The right way to get this done would be to give a filter that modifies the SQL accustomed to create the listing of posts. The tricky part would be to not filter it if you are within the admin section, otherwise you may never call at your private posts again. Where with this filter is within your theme's functions.php file. Here's what you need to place in there:

add_filter('posts_where', 'no_privates');
function no_privates($where) {
    if( is_admin() ) return $where;

    global $wpdb;
    return " $where AND {$wpdb->posts}.post_status != 'private' ";
}