password protect a template (3 posts)

  1. webwitch
    Posted 6 years ago #

    I have a couple of password protected pages and I'd also like to protect the sidebar too. I have made a custom template so would like to password protect it so that the sidebar only shows when the person has entered the page.

    I have looked around for an answer but can't find anything. Anyone have any ideas? thanks.

  2. webwitch
    Posted 6 years ago #

    Didn't get any replies to this question alas but if anyone else is stumped by this I hunted around and added this code to the bottom of my custom template

    if ( !post_password_required() ) {
    include(TEMPLATEPATH . '/sidebar5.php');

    And it works!!!

  3. laurim
    Posted 6 years ago #

    Thanks, that solved my need, too!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.