0

everyone: this question seems pretty commmon to ask, but I did not find any answer.

I was wondering, if there is a php function that I could use to direct a user to the site's registartion page, so that I can use php instead of link that I need to customize every time I change the link.

THank you

2

It's simple, use the function is_user_logged_in:

<?php if ( is_user_logged_in() ) { ?>

    <a hef="link-for-logged-users"></a>

  <?php } else { ?> 

    <a hef="link-for-users-not-logged-in"></a>

<?php } ?>

See here http://codex.wordpress.org/Function_Reference/is_user_logged_in

| improve this answer | |

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.