(solved) Question for those who know how to tweak WordPress

9 replies
Update: Appears to be solved -- thanks all!


---


When you password-protect a WP post, it shows visitors a standard spiel. (This post is password protected. To view it please enter your password below.)

I figured out how to change that text to something else by following the instructions here.

However, I have a question -- is there a way to add a live link to the text?

What I'd like to do is tell people to join a mailing list to get the password -- and then I'd like to link directly to the page where folks can join my mailing list.

However, I'm not a techy. At all. So I don't know how to do this without messing up everything else.

So, does anyone know how to insert a hyperlink into that text?

Many thanks,
Becky
#question #tweak #wordpress
  • Profile picture of the author petelta
    What file do you change the text in? If it's just a php file you can add simple <a href> to the text.

    I haven't messed around with the password protected area of WP but I know how to tweak it.
    Signature
    TEESPRING Student Rakes In Over $116k In Less Than 3 Months
    Niche Pro Profits - How I raked in OVER $120k in 9 months with authority niche sites...

    {{ DiscussionBoard.errors[1897290].message }}
  • Profile picture of the author tbunch
    Have you tried something like adding this:

    <a href="http://www.myblog/sign_up_page">Click here</a>

    I haven't done an password protected posts but this is a basic link structure.
    {{ DiscussionBoard.errors[1897297].message }}
  • Profile picture of the author Istvan Horvath
    There are two methods on that WP Support page:
    1. messing with the core files
    2. Adding something to the functions.php of your theme

    I'd suggest to go with the second one. And replace this thext:
    HTML Code:
    <p>This post is password protected. To view it please enter your password below:</p>
    with the one you want with your link:

    HTML Code:
    <p>This post is password protected. To get your password go here <a href="http://example.com/optinpage.html">subscribe</a></p>
    It should work.
    Signature

    {{ DiscussionBoard.errors[1897305].message }}
  • Profile picture of the author Andy Fletcher
    Quoted from the page you linked for context -

    You can change that in wp-includes/post-template.php around line 1141. Look for this: <p>' . __("This post is password protected. To view it please enter your password below:") . '</p>

    and change it to this:
    <p>' . __("Whatever you'd like it to say") . '</p>

    Keep in mind though that changing that text will change it globally, meaning whatever you change it too will appear on any post or page that is password protected.

    Hope that helps!
    You can add your link anywhere inside the text contained within __("Some text") but if you try to include normal HTML it'll break because of the quote marks.

    So change it as follows -

    PHP Code:
    __'Some text <a href="http://domain.com/page.html">anchor text</a> some more text' 
    Note the double quotes have been swapped for single quotes so the HTML won't get screwed up!

    Hope that helps,

    Andy

    Edit to add: The __() function is used by Wordpress to provide "localization" so unless you're publishing in multiple languages you can just remove it entirely and include your regular text inside the <p> tags.
    {{ DiscussionBoard.errors[1897310].message }}
  • Profile picture of the author LMC
    Hey Becky,

    I actually have installed an Opt-In Form on my protected pages so that readers can signup for the list right then and there to get the password automatically emailed to them, which is controlled by the autoresponder.

    I think this might work more efficiently.
    {{ DiscussionBoard.errors[1897321].message }}
  • Profile picture of the author Istvan Horvath
    As we know, if you mess with the a core WP file... you will need to re-do it after each and every upgrade.

    If you go with the other solution: adding code to your theme's functions.php file - you don't have to worry about the upgrades.

    Otherwise, the end result is the same - just less headache if you leave alone the core files...
    Signature

    {{ DiscussionBoard.errors[1897323].message }}
  • Profile picture of the author R Hagel
    Thanks, all!

    Looks like Andy has the solution -- many thanks!

    See, I tried the regular HTML code and it just messed everything up. So I do believe that what Andy has suggested will keep the gobbledegook from showing up on my screen again. I'll give it a whirl.

    Thanks again to everyone!

    Cheers,
    Becky
    {{ DiscussionBoard.errors[1897332].message }}
    • Profile picture of the author JayXtreme
      Originally Posted by R Hagel View Post

      Thanks, all!

      Looks like Andy has the solution -- many thanks!

      See, I tried the regular HTML code and it just messed everything up. So I do believe that what Andy has suggested will keep the gobbledegook from showing up on my screen again. I'll give it a whirl.

      Thanks again to everyone!

      Cheers,
      Becky
      Hi Becky...

      Although you have found your answer..

      I thought you might be interested in this:

      Membership Site Plugin - Wordpress Membership Plugin - MemberWing <-- Not my product, no affiliation

      John Taylor had a very interesting thread about how he used it here...

      http://www.warriorforum.com/main-int...blueprint.html

      I thought it may be useful in your situation, because it isn't a full blown membership area type thing... more of a small tweak to give your blog an extra little sumthn'

      Peace

      Jay
      Signature

      Bare Murkage.........

      {{ DiscussionBoard.errors[1897374].message }}
  • Profile picture of the author R Hagel
    Much appreciated, Jay.

    Cheers,
    Becky
    {{ DiscussionBoard.errors[1897417].message }}

Trending Topics