0

I'm trying to display a text if users are on X page and after they entered the password of the page (wordpress):

<?php if ( is_page('1361') ) && if ( !post_password_required() ) { echo 'TEST'; } ?>

Unfortunately nothing is displayed.. what am I doing wrong? :)

MultiformeIngegno
  • 6,841
  • 14
  • 57
  • 111

1 Answers1

0

There are some error in your script

 if ( is_page('1361') ) && if ( !post_password_required() ) { echo 'TEST'; } 
                      ^     ^ ^                    

It should be

if (is_page('1361')  && !post_password_required()) {
    echo 'TEST';
}

Or

if (is_page('1361')) {
    if (! post_password_required()) {
        echo 'TEST';
    }
}

My Advice : Get a PHP IDE you would easily spot such simple errors

Community
  • 1
  • 1
Baba
  • 92,047
  • 28
  • 163
  • 215