Support » Fixing WordPress » How do I a link to the Password Protected text?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Anyone?

    Did you step out of your php code before the html link and then back in again? For example:

    <?php a bunch of php code here... (and close the php tag) ?><a href="the-web-address" >the clickable text</a><?php (start back up with more php...)

    I tried that but there is still an error, can you be more explicit?

    Here is the code I used:

    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 FWR members only. To gain access, please") .' ?><a title="Subscriptions" href="http://williamsburgrowing.org/for-donors/subscriptions/">subscribe.</a><?php </p>
    <p>' . __( Existing 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 ") .' ?><a href="mailto:vicepresident@williamsburgrowing.org">vicepresident@williamsburgrowing.org</a> <?php </p>
    	';
    	return apply_filters('the_password_form', $output);
    }

    Sorry Thomas, but I haven’t looked at or used that pwd protect form before. My comment was just a general note about mixing html and php. Seems to be a stickler for lots of folks, myself included.

    I may take a look later if I can, but for now I’d offer this: there seems to be a missing double-quote before ‘Existing members’ on line 6 above. Add that and see what changes for you. Those pesky quote marks love to throw their weight around. Hopefully someone who really knows their stuff will notice this thread and fix you up. Good luck!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How do I a link to the Password Protected text?’ is closed to new replies.