Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1226554

    I created a password protected page but the sidebar is still showing on this page.

    I added this code to the enfold child theme functions.php

    if ( ! post_password_required()) {
       get_sidebar();
    }

    https://ketones.nicole-ebert.de/trainings-area/

    But as soon as I do the page isn’t working anymore.
    Do you have a solution for this?

    • This topic was modified 4 years, 4 months ago by Sheraly93.
    #1227686

    Hey Sheraly93,

    Thank you for the inquiry.

    We tested the modification in the page.php file and it seems to be working correctly. Do you see any errors in the page when the modification is added?

    Please enable debugging in your installation and post the error on pastebin.com

    // https://wordpress.org/support/article/debugging-in-wordpress/#example-wp-config-php-for-debugging

    Best regards,
    Ismael

    #1228268

    Okay solved!

    I added the wrong code to the wrong file.
    This is the right code:

    if ( ! ( $post->post_password && post_password_required() ) ) get_sidebar()

    And I added it to functions.php instead of page.php

    You can close it now. Thank you.

    #1228429

    Hi,

    If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Sidebar on Password Protected Pages’ is closed to new replies.