Forums

Cant get Password Protection to work on posts page (19 posts)

  1. halfacre
    Member
    Posted 11 months ago #

    Hi. I've tried password protecting my posts page using WP's built in password protect functionality (on Edit Page under the "publish" heading, under visibility. I've done this successfully on other blogs by doing nothin more than clicking edit, clicking "password protected," filling in my password and updating.

    This time not so simple. So far I've tried the following:

    • Clearing cache
    • Different browsers and platforms
    • Deactivated all plugins
    • Updating to latest version of WordPress
    • Switching to default theme (twenty ten and andreas09, which is my parent theme).
    • Reset my permalinks to default, tested unsuccessfully, switched back to numeric
    • Made sure my WordPress URL and site URL matched in General settings
    • Checked .htaccess file to see if leftover code was causing the issue, but I didn't see anything I would consider a red flag, though my understanding here is very limited. Here's what's in there:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    These are all the ideas I've seen presented on the forums. Is there anything else I can try? Please see http://rtdsmartcard.com to see what I mean. Thanks all!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 11 months ago #

    Try resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

  3. halfacre
    Member
    Posted 11 months ago #

    Thanks for the suggestion, esmi. I really thought it would work, too, but unfortunately, no dice.

    It says the page is password protected on Pages, but I just can't get the password prompt to show up anywhere.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 11 months ago #

    Ah! Is this a Page of Posts? If so, have a look at http://quirm.net/2010/09/08/protected-page-of-posts/

  5. halfacre
    Member
    Posted 11 months ago #

    Ah ha! Yeah, I think we're closing in. One thing: I'm still too much of a scrub to know for sure which file to edit if I'm using the default template for my page of posts. Is it archives.php?

    Yeah, I'm really showing my hiney now. Thanks esmi!

  6. halfacre
    Member
    Posted 11 months ago #

    It's page.php, isn't it? ;)

  7. esmi
    Theme Diva & Forum Moderator
    Posted 11 months ago #

    Which page are these posts on? Are you using a static front page?

  8. halfacre
    Member
    Posted 11 months ago #

    Yeah, static front, with an updates and Comments section that displays the posts.

  9. halfacre
    Member
    Posted 11 months ago #

    So I made a custom template for this page of posts by duplicating page.php in the child theme directory, added the following to the top of the file:

    <?php
        /*
        Template Name: Page of Posts
    
        */
        ?>

    I added the code snippets from quirm.net (as best I could anyway, since my template and the one the author used for an example were nothing alike – I had to fiddle with it to make sure there were no syntax errors), saved, uploaded it and changed the template on the pulldown menu on the Edit page for Updates & Comments.

    On the bright side, the page does not break. It simply displays the same way it did before, with no password prompt. This is, of course, in a browser where I am not signed in as admin.

  10. halfacre
    Member
    Posted 11 months ago #

    *sigh* Still no luck. I tried working in those code snippets to page.php like so:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    No syntax errors, but it still doesn't work. Am I just way off base?

  11. christogeretz
    Member
    Posted 11 months ago #

    A plugin is out of the question?

  12. halfacre
    Member
    Posted 11 months ago #

    @christogeretz Not at all, but unfortunately I've been striking out there too. I've tried Members Only, Password Protect All Posts, Registered Users Only and none of them did what I really wanted, which was simply to have the Updates and Comments page not reveal it's content to anyone without the password. Password Protect All Posts did just what it claimed, showing the title of each of the posts but hiding the content (not ideal for me). Registered Users Only and Members Only required a WordPress login, and for the life of me I couldn't see how to create or assign a password, it just looked like someone had to create a wordpress account, which didn't make sense to me, and I eventually abandoned it. If you know of one that does what I need, I'd sure appreciate a heads up on it. I just can't understand why the built-in WP functionality doesn't work.

  13. christogeretz
    Member
    Posted 11 months ago #

    I use Members Only .. yes, you have to create a user and assign a password - worked for me but if you just want a password without a username it's a little different!

  14. halfacre
    Member
    Posted 11 months ago #

    I'm not too picky... I don't mind setting up a username if I have to. The big thing with Members Only is that it protects the whole site, rather than just a specific page (in my case, the page of posts). Am I wrong about that?

  15. christogeretz
    Member
    Posted 11 months ago #

    Sorry - I should have double-checked.

    Check out the plugins "Page Restrict" and "WordPress Access Control" - I use them both in conjunction.

  16. halfacre
    Member
    Posted 11 months ago #

    @christogeretz - Thanks for the suggestions. I installed both the plugins, but I run into the same problem - I can not restrict access to the page. I mean, I can TELL it to do so, but it will not do it for the page of posts. It does work on the other non-post pages. This must still be due to a "page of posts" being considered an archive. I'm at a loss. The link esmi supplied seems to be the only one on the internet that addresses this issue, and I couldn't get it to work. Heck, it even turns out that code on quirm.net is invalid syntax. Seemed so promising, too.

    As far as plugins that require users to be logged-in (like Members Only or WordPress Access Control), "logged-in" means they need to be logged in to WordPress, which seems really counter-intuitive in practice... visitor tries to access page, is sent to a WordPress login requesting a username and password. Visitors to this site will not likely have a WP account, and there is no link there to register for WP. What's a user to do? Does anyone else agree that this seems kinda non-user-friendly? Am I missing the forest for the trees? I *am* pretty green.

  17. halfacre
    Member
    Posted 11 months ago #

    I'm not sure, but I guess it's possible I really screwed things up somewhere along the line, because he page of posts remains the same template, even if I switch it from three to two columns (or to anything else for that matter, so for all I know it's not reading those code snippets I added to the pageofposts.php template because it's not actually using it (even though the pulldown idicates that it is).

  18. halfacre
    Member
    Posted 11 months ago #

    Okay, in the codex it says not to use a custom template for a page of posts. It doesn't say why, but clearly it's ignored, so I guess that's a good enough reason. So there's no way to have a custom template on a [age of posts?

  19. kaine83
    Member
    Posted 10 months ago #

    @esmi thanks so much for sharing the link (http://quirm.net/2010/09/08/protected-page-of-posts/)

    I've been tearing my hair out to find that!

Reply

You must log in to post.

About this Topic