Private Content Template

I was recently asked to make a website where a substantial amount of the content would be accessible to contributors only. There is a very good plugin called Private Suite that’s designed to handle this requirement but, as so often happens with plugins, it didn’t quite achieve what I wanted. I opted instead to use custom templates.

In its simplest form the technique works like this:

1. Rename category.php to category-private.php.
2. Make a new file called category-public.php where the loop is replaced by a statement such as: “Access to posts in this category is restricted to members.”
3.  a new category.php file as shown below:

In a standard WordPress installation the levels translate as follows:

Level 1: Contributor
Level 2: Author
Level 5: Editor
Level 8: Administrator