0
<?php
if ( is_user_logged_in() ) {
echo '';
} else {
echo '<a onclick="ppOpen('#login_panel', '800',1)" href=\"javascript:\">Entrar</a>';
}
?>

Hello, I'm trying to make this work but i'm not sure how to do the syntax.... any help would be great! thanks!

1
  • <?php if ( is_user_logged_in() ) {echo ''; } else { echo "<a onclick=\"ppOpen('#login_panel', '800',1)\" href=\"javascript:\">Entrar</a>"; } ?> I've done this and it works, do you think is correct?
    – Lucas
    Jul 27 '14 at 15:19
0

It is string escape problem with PHP Syntax

Correct Code:

<?php
if ( is_user_logged_in() ) {
echo '';
} else {
echo '<a onclick="ppOpen(\'#login_panel\', \'800\',1)" href="javascript:void(0)">Entrar</a>';
}
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.