wordpress中密码保护页面的模板文件在哪里?

wordpress中密码保护页面的模板文件在哪里?,wordpress,wordpress-theming,Wordpress,Wordpress Theming,我正在尝试编辑模板页面,当页面或帖子受密码保护时使用该模板页面。我似乎找不到它 你知道它在哪里吗?据我所知,受密码保护的页面/帖子使用的模板与普通页面/帖子相同。如果你想更改标准邮件,我的帖子有密码保护。请向我询问密码:,尝试添加此代码段,更改文本以阅读您希望如何添加主题的function.php文件: function fb_the_password_form() { global $post; $label = 'pwbox-'.(empty($post->ID) ?

我正在尝试编辑模板页面,当页面或帖子受密码保护时使用该模板页面。我似乎找不到它


你知道它在哪里吗?

据我所知,受密码保护的页面/帖子使用的模板与普通页面/帖子相同。如果你想更改标准邮件,我的帖子有密码保护。请向我询问密码:,尝试添加此代码段,更改文本以阅读您希望如何添加主题的function.php文件:

function fb_the_password_form() {
    global $post;

    $label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID);
    $output = '<form action="' . get_option('siteurl') . '/wp-login.php?action=postpass" method="post">
    <p>' . __("My post is password protected. Please ask me for a password:") . '</p>
    <p><label for="' . $label . '">' . __("Password") . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr__("Submit") . '" /></p>
    </form>';

    return $output;
}
add_filter('the_password_form', 'fb_the_password_form');

我在。

上发现了这一点。据我所知,受密码保护的页面/帖子使用的模板与普通页面/帖子相同。如果你想更改标准邮件,我的帖子有密码保护。请向我询问密码:,尝试添加此代码段,更改文本以阅读您希望如何添加主题的function.php文件:

function fb_the_password_form() {
    global $post;

    $label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID);
    $output = '<form action="' . get_option('siteurl') . '/wp-login.php?action=postpass" method="post">
    <p>' . __("My post is password protected. Please ask me for a password:") . '</p>
    <p><label for="' . $label . '">' . __("Password") . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr__("Submit") . '" /></p>
    </form>';

    return $output;
}
add_filter('the_password_form', 'fb_the_password_form');

我在。

上找到了这一点。在一个儿童主题为“二十一三”的作品中,上述内容不起作用。相反,我使用了这段代码,不幸的是,我不记得是谁写的:

<?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">
    ' . __( "Some custom statement here.\nAnd a second line:\n" ) . '
    <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><p style="font-size:18px;margin:0px; padding: 8px; background: lightblue; height: 40px; width: 400px; text-align: center;">Some other text here</p>
    ';
    return $o;
}
add_filter( 'the_password_form', 'my_password_form' );
?>

在一个儿童主题的二十三,上述没有工作。相反,我使用了这段代码,不幸的是,我不记得是谁写的:

<?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">
    ' . __( "Some custom statement here.\nAnd a second line:\n" ) . '
    <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><p style="font-size:18px;margin:0px; padding: 8px; background: lightblue; height: 40px; width: 400px; text-align: center;">Some other text here</p>
    ';
    return $o;
}
add_filter( 'the_password_form', 'my_password_form' );
?>
此代码来自此代码来自