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?
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
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.
Hi,
If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon