August 16, 2010
Protecting WordPress Content
Since WordPress has its own built in user roles it is possible to protect WordPress content for users that are logged in, rather than general visitors. This can be very handy if you want to show certain things only to those people who are logged in. In this post I will show you how to implement this as well as showing you an example.
Thanks to WordPress’ comprehensive template tags the function to test whether or not a user is logged in or not is already present. By combining this function with a php if statement we can check whether the user is logged in and then display something accordingly.






