Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #895032

    Hi

    I have one page on my site that is password protected (via the post options). When the password protected page opens, it has a header and menu displayed, which I don’t want as I don’t have a header or menu on any other pages (don’t ask…)

    I just want the password page (the one that says “This content is password protected. To view it please enter your password below:” to display the message and the form box only. No menu, no header.

    I can’t find that page anywhere to customise! I’d also like to be able to alter that message, and create a message when someone puts in the wrong password.

    Can anyone help?

    Thank you!

    #895119

    Hey victoria,

    Maybe this thread will help you out? https://kriesi.at/support/topic/edit-contenttext-on-password-protected-page/

    Best regards,
    Rikard

    #895149

    Hi Rikard

    Thank you for that. I will put it to work!

    It doesn’t help me with the menu/header problem, however. There is still a header with a menu on the password protected page that I can’t get rid of (despite not having any menu’s set up, it’s pulling them from my page titles anyway).

    I’m sure there must be a simple line of code to made that page not have any header, though I can’t find any way to identify that page to edit it!

    Thank you

    #895157

    A little extra information, as I have read through the other post you highlighted and it explains that the password page isn’t really a page, but just covers up the content until you unlock it.

    I have a landing page, you press a button to visit the next page – which is password protected.

    There is no menu set in Appearances, the header/sidebars/footer etc are all removed from landing page and from the main content page (once password accepted). So no header/menu on either of the pages. BUT when the password form comes up, it sticks a header&menu at the top. So I don’t know where it’s getting that instruction from.

    Thanks

    #895178

    Hi,

    Thanks for the feedback, could you post a link to your site so that we can have a closer look at it? Also please post a link to a password protected page, maybe we can give you some CSS to use.

    Best regards,
    Rikard

    #895205

    Ok, some information below

    #896268

    Hi,

    Just add
    #header_main { display: none; } to quick fix your issue as it is not something big
    and you are simple done.

    There is no ” canva ” template option into Enfold.

    Best regards,
    Basilis

    #902464

    Brilliant. Thank you for this. That has worked a treat.

    I don’t know how, but I have lost the code that I had added that brought up a message when an incorrect password is attempted.

    I’ve tried inserting various code that I’ve found on forum threads and the internet, but can’t get it to work. Not sure how I did it last time, or where it’s gone!

    Are you able to give me code to add to create an incorrect password message, please?

    I have added the following to functions.php to change the ‘please input password’ text:

    add_filter( 'the_password_form', 'custom_password_form' );
    function custom_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' ) ) . '" class="post-password-form" method="post">' . __( "You can write your own text here" ) . '
    <label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
    </form>
    ';
    return $o;
    }
    #904170

    Hi,

    Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)

    Best regards,
    Basilis

    #1154410

    I will change the text of the Password protection page. But, if i will add a link, the funktion.php does not aczept this. What is the right way to put a link next to the text? If i do like in the code, it does not work.

    add_filter( 'the_password_form', 'custom_password_form' );
    function custom_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' ) ) . '" class="post-password-form" method="post">' . __( "You can write your own text here <a href=\"https://nameofthepage/undername/\">linkname</a>" ) . '<label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
    	</form>';
    	return $o;
    }
    • This reply was modified 5 years ago by Micha66.
    #1155529

    Hi,

    Sorry for the delay. You have to properly escape the double quotes inside the link tag.

     <a href=\"https://nameofthepage/undername/\">linkname</a>"
    

    We modified the code a bit — added backslashes before the double quotes. Please try it again.

    Best regards,
    Ismael

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.