• I’m trying to password protect a page that references a page template, and I cannot seem to get it to work. If I choose my custom page template, no password is requested and the page is publicly accessible.

    This is the page: https://www.dustinbrown.com/portfolioprivate/

    I am using the Grid Focus theme.

    If I switch to Default Template, I get the password request form, but that isn’t a viable option because my site is set up to use templates. Beyond that, I don’t know if the theme is also getting in the way of this working in addition to the template. I suppose it’s a possibility.

    If there is some snippet of code I can add to my template or something within my theme, please let me know.

Viewing 1 replies (of 1 total)
  • Thread Starter dustinbrown

    (@dustinbrown)

    Bump. I found an article that suggests using the PHP function:

    <?php
        if ( !post_password_required() ) {
                echo 'protected stuff';
        }
    ?>

    But I tried pasting that into my page template and it didn’t work. Am I expected to replace ‘protected stuff’ with something?

Viewing 1 replies (of 1 total)
  • The topic ‘Password Protecting a Page That Uses a Custom Page Template’ is closed to new replies.