Changing message for password protected posts

Community Forums Forums Design Tips and Tricks Changing message for password protected posts

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  Susan 1 year, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5300

    john gronley
    Participant
    Post count: 124

    Hello;

    I am getting this display in Google Chrome when I protect a post: There is no excerpt because this is a protected post. But when I go into firefox>firebug to find where this message is so I can change it; the message is not displayed. Does anyone know where I can find this message to change it to “enter your password to view this post”?

    Thanks,

    John

    #5314

    Susan
    Moderator
    Post count: 9253

    While trying to come up with a solution, I found a thread on the old forum, with a warning:

    Do NOT try the editing WP files method scroll down and find the code to add to functions.php make sure you add the code BEFORE the closing ?> or the sky will fall

    http://wordpress.org/support/topic/this-post-is-password-protected

    Add this to your functions.php file (leave out the < code > and </ code > part…)

    // Password Protected Page Message function custom_password_form($form) { $subs = array( '#<p>This post is password protected. To view it please enter your password below:</p>#' => '<p>Hopefully this works.</p>', '#<form(.*?)>#' => '<form$1>', '#<input(.*?)type="password"(.*?) />#' => '<input$1type="password"$2 />', '#<input(.*?)type="submit"(.*?) />#' => '<input$1type="submit"$2 />' ); echo preg_replace(array_keys($subs), array_values($subs), $form); } add_filter('the_password_form', 'custom_password_form');

    Susan @ Graphically Designing I offer theme customizations I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

    • This reply was modified 1 year, 10 months ago by  Susan.
    • This reply was modified 1 year, 10 months ago by  Susan.
    #5318

    john gronley
    Participant
    Post count: 124

    Thanks Susan I also found an article in the wordpress codex and found the verbiage in the wp-includes.php file and changed the verbiage.

    Thank you for your response!

    #5324

    Susan
    Moderator
    Post count: 9253

    You’re welcome – glad you were able to resolve the issue!


    Susan @ Graphically Designing I offer theme customizations I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Changing message for password protected posts’ is closed to new replies.