Matt Elhotiby
Matt Elhotiby

Reputation: 44066

Is there a way in wordpress that will only allow people to view the posts if they are a user?

Is there a way in wordpress that will only allow people to view the posts if they are a user? So i have a wordpress blog that I need to only make available to users that get an invite code and are registered users ...is there a way to lock down the posts and pages to logged in users

Upvotes: 0

Views: 391

Answers (2)

Jakub
Jakub

Reputation: 20475

Wordpress offers you a way to publish as private (default is public). No code changes required.

Then users have to be signed in and able to view it.

Upvotes: 0

Chris McClellan
Chris McClellan

Reputation: 1105

http://codex.wordpress.org/Function_Reference/is_user_logged_in This can be implemented within the wordpress loop.php file:

<?php
if (!is_user_logged_in() ): ?> 
  <p>This content is restricted to members only</p>
<?php else: ?>
  // the regular wordpress loop
<?php endif; ?>

Upvotes: 1

Related Questions