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, 2014 at 15:19

1 Answer 1

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 and acknowledge you have read our privacy policy.

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