WordPress.org

Ready to get started?Download WordPress

Forums

Restrict Custom Category Template from Public (3 posts)

  1. imikedesigns
    Member
    Posted 2 years ago #

    I am using custom category templates to display different categories. One category needs to be restricted to only contributors and above, or, current_user_can('edit_posts'). Any post in this category, as well as the category page should not be visible to anyone that cannot edit posts. Normally, Capa Protect would do the trick, but it doesn't work with custom page templates, so im guessing thats why its not working with custom category templates. Thanks for any advice.

  2. imikedesigns
    Member
    Posted 2 years ago #

    Anyone?

  3. esmi
    Forum Moderator
    Posted 2 years ago #

    I've not tried this but doesn't something really simple like:

    <?php if (have_posts() && current_user_can('edit_posts') ) : while (have_posts()) : the_post(); ?>

    work?

Topic Closed

This topic has been closed to new replies.

About this Topic