I'd like to display a message when current user's post is set to private. The code below does this, however only works when you are on the actual post page. I'd like for my message to be displayed site wide for the user.
<?php
// if post is private and needs to be approved by an admin
if(is_single() && get_post_status() == "private" && get_post_meta(get_the_ID(), "notactive", true) == "1" && (get_the_author_meta('ID') == $userid || current_user_can('level_10'))) {
if(current_user_can('level_10')) { ?>
x posts are set to private
of/for the current user? X being the number of posts the user has set to private, of which it only shows to the current user.