Adding a link to Password Protection Text in the post-template.php
-
I want to add a link to the text that gets displayed over password protected posts.
Whenever I try to just simply add the html code in the php file where I have the text, I get a T string error.
I know there is something wrong with the code I’m adding to the post-template.php.I want to know how to fix this.
For example, I want the words “Subscribe” and “vicepresident@williamsburgrowing.org” to contain links.
See here:
http://williamsburgrowing.org/2013-colonial-erg-sprints-coachs-summary/Here is the code:
function get_the_password_form() { $post = get_post(); $label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID ); $output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post"> <p>' . __("This post is for members only. To gain access, please subscribe. Members enter your password below:") . '</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> <p>' . __("Lost or forgotten password? Please email vicepresident@williamsburgrowing.org") . '</p> '; return apply_filters('the_password_form', $output); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Adding a link to Password Protection Text in the post-template.php’ is closed to new replies.