For anyone else struggling with this, I found an answer. Put this in your theme’s functions.php
function customarchives_where( $x ) {
return $x . " OR (post_type = 'post' AND post_status = 'private')";
}
if ( is_user_logged_in() ) {
add_filter( 'getarchives_where', 'customarchives_where' );
}
If a user is logged in, the archives widget will now include private posts.
Comments from any wordpress pros as to whether this is the best way to do this are more than welcome!
Hello
Thks for this sharing
But When I put your code, inside my functions.php file ,I doesn’t have the result expected with all widgets plugged on my right menu.
These widgets are included with the basic version of WordPress 3.5.1 or with the jetpack package.
I precise that all my articles are private
For example, I can’t see the last articles or in the calendar of articles: there is no traces of my articles arranged by date
May be , do you have any suggestions ?
Thk
SQALG