• Hi

    When a page is password protected we see the message “This post is password protected” and i want to change that to something like –please enter the password…..– and somebody please let me know which file is to be tweaked for that. thank you everybody in anticipation

    Jimmy

Viewing 3 replies - 1 through 3 (of 3 total)
  • There is this thread,

    https://www.ads-software.com/support/topic/99463

    However that was awhile ago. Perhaps Otto or someone else can confirm if that still works.

    As long as the message is being output by the_content() it will work. For example, most comments templates will have a bit of code restricting access to comments when a post is password protected. This would have to be edited manually.

    The advice at https://www.ads-software.com/support/topic/99463i still works. This was a really helpful thread. I was able to change my “protected post” text and add information on how to subscribe to my “VIP” content, which clarified for my visitors, where they needed to get the password for the post. It was exactly what I was looking for. Thanks Otto for the great advice

    You can view how I used this in my page at https://hampton-family.com/Yvette/?p=161

    My functions.php file looks like this now

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar(array(
            'before_widget' => '<div class="block">',
            'after_widget' => '</div>',
            'before_title' => '<h3 class="widgettitle">',
            'after_title' => '</h3>',
        ));
    
    function change_pw_text($content) {
    $content = str_replace(
    'This post is password protected. To view it please enter your password below:',
    '<b><font color="red">***This post is password protected. To view it please enter your password below.***</font></b>
    To get your password, subscribe to our newsletter. Click the <b>*FREE Newsletter and Expert Tips*</b> link at the top of this page. You will be granted <b>VIP Access</b> to all of our content.',
    $content);
    return $content;
    }
    add_filter('the_content','change_pw_text');
    
    ?>

    Look at the support thread linked above. Otto explains how to modify or create the “functions.php” file to make this work. It is a lot easier than it looks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can i change the “this post is password protected” message’ is closed to new replies.