• How can I password protect this:
    this is a slideshow (custom page), although I’m selecting password protect in WordPress, does not work but, if is it private selected, does work.
    Any idea would be great, thanks…

    
    <?php
    include( 'header.php' );
    
    // Start the Loop.
    while ( have_posts() ) {
    		the_post();
    		the_content(); }
    
    	include( 'footer.php' );
    ?>
    
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Handling, saving, verifying passwords is rather involved. You are better off determining why password protection does not work. You do know only the content is hidden by a password, yes? The rest of the page appears normally.

    Would managing access by capability work for you? While capabilities are normally assigned to roles, they can be assigned to individual users as well. You could create a custom capability, and assign it only to those users and/or roles that you wish to have access. Then you can just as easily remove capability from specific individuals. This is better IMO than using a page password shared by everyone.

    If you want to remove someone from those able to access a password protected page, you have to change the password and notify everyone else of the new password. Capabilities are not difficult to code, or you can use one of the several capability and role managing plugins. Then on your page template, just add something like this below the header:
    if ( ! current_user_can('see_restricted_material')) wp_die('Go back, nothing to see here!');

Viewing 1 replies (of 1 total)
  • The topic ‘Password protect Custom index.php’ is closed to new replies.