Adult Content Warning

This community may contain adult content that is not suitable for minors. By closing this dialog box or continuing to navigate this site, you certify that you are 18 years of age and consent to view adult content.

Any Wordpress Experts Here?

Discussion in 'Technical Board' started by walt, Feb 11, 2025.

  1. walt

    walt
    Expand Collapse
    Emotionally Jaded

    Reputation:
    479
    Joined:
    Oct 21, 2009
    Messages:
    2,461
    I have a Wordpress website and recently added a new, password protected page that will be used for my readers who sign up for an email list to get the first look at new stuff, merch, sales, etc.

    The password protection works for the page, but the sidebar for that page still shows up without entering the password. So the sample stuff I have on there right now is visible to everyone. I only want the sidebar visible after the user enters the password.

    I’ve been searching for a solution and coming up empty. Part of the problem is I’m really not that knowledgeable about this stuff. I’ve tried a few plug ins that are supposed to help but they haven’t. My coding experience is “copy and paste” trial and error, and only if told where to put it. ( Honestly it’s a miracle I haven’t screwed up nuked everything on more than on occasion. )

    Does anyone have any kind of experience with this sort of thing? If I can’t get this to work I’ll have to find another way to accomplish this. The sidebar and widgets is just the best looking as well as easiest way to go.
     
  2. Binary

    Binary
    Expand Collapse
    Emotionally Jaded

    Reputation:
    442
    Joined:
    Oct 21, 2009
    Messages:
    4,312
    You can do this, I believe, using PHP and editing your theme files directly. But it's kinda awkward - how can a user enter a password if they can't see a link to where they need to enter the password? And if you're already requiring them to click on the email link because you aren't exposing the protected page on the site until they've already clicked on the link and typed in the password, then why not just make the email link the primary way that a user is going to access the hidden page?

    Personally, I would just clearly label the content, e.g.:

    My Content
    • Home
    • Cool Stuff
    • How To
    • Sign Up For My Email List
    Subscribers Only
    • Upcoming releases
    • Sales
    • Exclusive merchandise

    I think it's a perfectly reasonable user experience to see content links that you don't have access to as long as it's clearly labeled as such. Slap an email list link on the password prompt page so people know they can sign up to get the password, and away you go. Otherwise you're just displaying new content in the (likely rare) situation where a user has clicked over on a link from the email, then clicked out of the special page, then wants to go back to it - in which case they can just flip back to their email.

    That said, you can probably do this using the post_password_required() function, and creating a shortcode in your functions.php. I might be able to help with that but make sure you actually want to bother with it first.
     
  3. walt

    walt
    Expand Collapse
    Emotionally Jaded

    Reputation:
    479
    Joined:
    Oct 21, 2009
    Messages:
    2,461
    I will DM you so you can see what I mean.

    I thought I'd found a plug in to do the job I'm looking for but then it wouldn't allow a sign in when the password was entered.