I need to make a private page for subscribers in my Wordpress website I don’t want to use plugins so I’m asking what is better, add the capability to subscribers to read private pages or maybe create a custom page template with conditions?
You can do it without plugins, you just have to allow
subscribers to see Private posts and pages, depending on what you want, so you have to put this code in your functions.php
$subRole = get_role( 'subscriber' ); $subRole->add_cap( 'read_private_posts' ); $subRole->add_cap( 'read_private_pages' );
And then simply create a private post or page and it will works as expected. Tested.