• <?
    get_currentuserinfo() ;
    global $user_level;
    if ($user_level > 0) {
    echo “yes”;
    } else {
    wp_register();
    }
    ?>

    If I’m not logged in it sends nothing. If I am it sends yes. Why is wp_register(); not working?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Do you have “Anyone can register” checked in the Membership settings under Options > General?

    Thread Starter Rub3X

    (@rub3x)

    Lmfao. I forgot this was my test blog, and that was not enabled by default. Wow. Anyways how do I just get the hyperlink to the register form then? I wanted to make a link that says “Why register?” that links to the register form.
    wp_register(‘Why ‘, ”);
    Doesn’t hyperlink the “Why” part.

    wp_register('Why ', '');

    Yeah, that would insert “Why” as the prefix or ‘before’ text, that is before the link.

    wp_register() just outputs a link (in a <li> tag) to wp-login.php with a special ‘action’ query, so you could code up your own:

    <li><a href="<?php blgoinfo('home'); ?>/wp-login.php?action=register">Why register?</a></li>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘If logged in’ is closed to new replies.