WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There's a specific category on my website that should be restricted to teachers only using login. However, I don't want to hassle the teachers with the not so welcoming admin Wordpress offers. I would like to offer a "lightbox" that's basically a login that doesn't automatically forward to the admin, but only makes the teachers category content available. Do you know any plugin that allows that? Thanks, Sarit

share|improve this question
up vote 2 down vote accepted

Don't know about a plugin that does that for you but you can use the WordPress native Thickbox:

enter image description here

First include the Thickbox script and style in your category only if the user is not logged in (simply copy/paste in your theme's functions.php file)

function add_thickbox_script_and_style(){
    if(is_category('YOUR_CATEGORY') && !is_user_logged_in()){
        wp_enqueue_style('thickbox.css', '/'.WPINC.'/js/thickbox/thickbox.css', null, '1.0');

Then open up your category.php (or archive.php depending on your theme , or even better is a custom file for that category category-id.php) and add this code before the loop:

if (is_category('YOUR_CATEGORY') && !is_user_logged_in()){
    echo '<div id="lform" style="display:none;">';
    echo '</div>';
    echo 'Please <a class="thickbox" href="#TB_inline?height=200&width=200&inlineId=lform">Login</a> to see the content';

//your loop goes here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.