-
AuthorPosts
-
July 9, 2015 at 8:29 pm #471118
When I password protect a page under privacy settings for that page (laughingbearranch.com/resources) is there a way to customize the page which appears asking for input of the password? I’d like to add some different copy and also shorten the field for the password to be input.
Thanks, kindly. JenJuly 10, 2015 at 12:14 am #471204Hi AirstreamCoach!
In order to change the protected page text you can either follow the instructions under the “Customize the Protected Text” section of the WordPress codex:
https://codex.wordpress.org/Using_Password_Protection
Or you can follow the instructions in the below forum page:
https://kriesi.at/support/topic/password-protected-page/
Cheers!
DakeJuly 10, 2015 at 12:31 am #471210PLEASE HELP. I tried using some of the code you directed me to in the appearance/editor functions/php and apparently messed it up and now my site is down. Please Help! Thanks! Jen
July 10, 2015 at 12:32 am #471211Parse error: syntax error, unexpected end of file, expecting ‘`’ in /home/content/p3pnexwpnas04_data02/30/2293230/html/wp-content/themes/enfold/functions.php on line 546
please help. thanks
July 10, 2015 at 12:43 am #471213Hi airstream,
In order to remove the error, please reupload a copy of your functions.php file or remove the code you added via FTP.
Best regards,
DakeJuly 10, 2015 at 1:05 am #471217got it! Thanks!!!
July 10, 2015 at 9:20 am #471338Hi!
Glad we could help, please let us know if you should have any more problems.
Best regards,
RikardJuly 10, 2015 at 7:03 pm #471683Hi AirstreamCoach,
I understand that your website it up and running again, but have you attempt using the methods described in the WordPress codex?
Regards,
DakeJuly 10, 2015 at 7:27 pm #471691oh my gosh!! So, YES, per your suggestion, I got brave again and just went in to try the wordpress code on that page .. AND NOW MY SITE IS DOWN AGAIN!! why do you keep suggesting i mess with the function.php file??? sorry but i can’t believe this has happened again and now i have to go back into the ftp. very frustrating. is there something wrong with the theme that I can’t paste this code into the editor without having my site crash???
July 10, 2015 at 7:38 pm #471696Now whenever i try opening the php file thru ftp and it fails. what do i do? please help me fix this and explain why the code is crashing my site, repeatedly. thanks.
July 10, 2015 at 7:40 pm #471698the code i tried using was from the link you gave me. it said this would allow me to modify the text displayed on the password protected page. it crashes my site. please help.
<?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’ );
?>July 10, 2015 at 7:44 pm #471701Parse error: syntax error, unexpected ‘<‘ in /home/content/p3pnexwpnas04_data02/30/2293230/html/wp-content/themes/enfold/functions.php on line 538
please help.
July 10, 2015 at 8:10 pm #471707Hey AirstreamCoach,
In order to bring your site back online, you’ll need to re upload your functions.php file.
The available code in the codex is the recommended method when editing the default password protection page.
You have 3 other alternatives that you can try:
– You can make a copy of the twentyfifteen theme’s functions.php file then attempt using the php code from the codex again.
– You can try using a password protection plugin that provides you with a member system and an editable password page.
– Lastly, you could try enlisting the help of a freelancer: http://kriesi.at/contact/customization
Cheers!
DakeJuly 10, 2015 at 8:23 pm #471711thanks. But, why does adding a code snippet crash my site? it’s a simple procedure, cut and past directly from the source, am placing it at the very end of the functions.php from within the editor.. am i doing something wrong?
July 10, 2015 at 8:30 pm #471714ps. i restored the .php again. so we are back up. thanks for your suggestions. i did look for a password protection plug in but didn’t find anything. do you recommend one? thanks and sorry for the panic. i’m probably doing something wrong in how i edit the php.
July 10, 2015 at 9:41 pm #471724Hi AirstreamCoach!
I double checked then noticed in your previous post, you were copying the php tags that are included in the code snippet as well.
Rightfully the only code you should be pasting is what’s within php tags because it is already open in the original document (functions.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' );
As for the protected page plugin, you can try a freemium plugin such as Membership 2.
Cheers!
DakeJuly 10, 2015 at 10:01 pm #471735that explains it. thanks.
July 10, 2015 at 10:32 pm #471740Hi AirstreamCoach,
You’re welcome. Please let us know if there’s anything else we can assist you with.
Cheers!
Dake -
AuthorPosts
- The topic ‘Displaying .pdfs’ is closed to new replies.