Below is the code to make private posts visible to subscribers in WordPress.
<?php | |
//* Make private posts visible to subscribers | |
function customprefix_private_posts_subscribers() { | |
$subRole = get_role( 'subscriber' ); | |
$subRole->add_cap( 'read_private_posts' ); | |
} | |
add_action( 'init', 'customprefix_private_posts_subscribers' ); |
Alternatively, you can download, install and set up Members from the WordPress Plugin Repository.