• I tried searching, but i couldn’t find anything.

    Is it possible to show if a post is private or not?

    I’m using the default Kubrick-based theme, and where it goes:

    Posted in Uncategorized | Edit | No Comments ?

    I want it to be:

    | Private | Posted in Uncategorized | Edit | No Comments ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • How to show a post as private
    This is a kind of oxymoron, isn’t it? If it’s private – it is NOT shown. Period.

    Rather than trying to make a post private, looking in to the “viewlevel plugin” which will allow you to set the user level needed to view a post.

    That way, you can set the level to be at Admin level and only those people can see the post. Leaves the rest of your posts uncluttered.

    Regards

    Actually, I am interested in liljoeyjordison’s request as well. ??

    Specificially, I would like to prepend an image to the post title if the post is private AND a different image to the post title if the post is password-protected.

    I realize that private posts don’t appear at all to non-admin users, but as admin, I would like to quickly scan through my blog to see which posts are private, protected, or both. Right now, I have to go to dashboard/manage/posts screen to see which ones are private.

    I see that the “protected” designation is in wp-includes/template-functions-post.php:

    function get_the_title($id = 0) {
    $post = &get_post($id);
    $title = $post->post_title;
    if ( !empty($post->post_password) )
    $title = sprintf(__('Protected: %s'), $title);
    return $title;
    }

    And the “private” designation (shown in the dashboard) is in wp-admin/edit.php:

    case 'title':
    ?>
    <td><?php the_title() ?>
    <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?></td>

    How do I add the private code to the get_the_title function, plus use images instead of text “Protected” and “Private”?

    Thanks for your help! ?? Jennie

    Thread Starter liljoeyjordison

    (@liljoeyjordison)

    thanks tanster, that’s what i meant- i just phrased my question sloppily. That <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?> works fine *thumbs up*

    Thread Starter liljoeyjordison

    (@liljoeyjordison)

    for the images thing, replace <strong>Private... with <img src="(directory of theme)/images/private.gif">

    There is a tag for the (directory of theme) but i forgot what that was…

    Thanks, liljoeyjordison, for the img code! ?? Jennie

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to show a post as private’ is closed to new replies.