WordPress.org

Ready to get started?Download WordPress

Forums

password protect a template (3 posts)

  1. webwitch
    Member
    Posted 4 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
    Member
    Posted 4 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

    <?php
    if ( !post_password_required() ) {
    include(TEMPLATEPATH . '/sidebar5.php');
    }
    ?>

    And it works!!!

  3. laurim
    Member
    Posted 3 years ago #

    Thanks, that solved my need, too!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.