Support » Themes and Templates » Can't find Password function to change Text on Password Protected page

  • Hello,

    I have found MANY great posts on how to add a function to customize the password text on the password protected page (i.e., “This content is password protected. To view it please enter your password below”).
    I would like to offer a link for the user to apply to get a password, but I cannot find the correct PHP file for the LIFE of me. Can someone please help.
    I have tried all the suggestions, and have searched through function.php, but cannot find the password function.
    Any ideas?
    Here is a list of my php files:

    404 Template
    (404.php)
    Archives
    (archive.php)
    Attachment Template
    (attachment.php)
    Comments
    (comments.php)
    content-aside.php
    content-attachment.php
    content-gallery.php
    content-page.php
    content-single.php
    content.php
    Theme Footer
    (footer.php)
    Theme Functions
    (functions.php)
    gallery-single-template.php
    Gallery Template Page Template
    (gallery-template.php)
    Theme Header
    (header.php)
    Main Index Template
    (index.php)
    legacy-comments.php
    admins.php
    (library/admins.php)
    defaults.php
    (library/defaults.php)
    legacy.php
    (library/legacy.php)
    misc.php
    (library/misc.php)
    navigation.php
    (library/navigation.php)
    options.php
    (library/options.php)
    shortcodes.php
    (library/shortcodes.php)
    sidebars.php
    (library/sidebars.php)
    smiley.php
    (library/smiley.php)
    widgets.php
    (library/widgets.php)
    wrappers.php
    (library/wrappers.php)
    One Column Page Template
    (onecolumn-page.php)
    Page Template
    (page.php)
    Search Results
    (search.php)
    Search Form
    (searchform.php)
    sidebar-bottom.php
    sidebar-default.php
    sidebar-footer.php
    sidebar-secondary.php
    sidebar-top.php
    Single Post
    (single.php)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Did anyone ever find this out?

    Hm I found something. Try making a plugin file and adding this to your php

    <?php
    function my_password_form() {
        global $post;
        $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
        $o = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">
        ' . __( "To view this protected post, enter the password below:" ) . '
        <label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" maxlength="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
        </form>
        ';
        return $o;
    }
    add_filter( 'the_password_form', 'my_password_form' );
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can't find Password function to change Text on Password Protected page’ is closed to new replies.