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')) { ?>