Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You can repeatedly concatenate additional menu items like so:

    if (is_user_logged_in())
    	$link = '<a href="' . wp_logout_url() . '" title="' . __('Logout') . '">' . __('Logout') . '</a>';
    else
    	$link = '<a href="' . wp_login_url() . '" title="' . __('Login') . '">' . __('Login') . '</a>';
    $items .= '<li id="log-in-out-link" class="menu-item menu-type-link">' . $link . '</li>';
    
    if (is_user_logged_in()) {
            $link = '<a href="' . wp_registration_url(); . '" title="' . __('Register') . '">' . __('Register') . '</a>';
            $items .= '<li id="register-link" class="menu-item menu-type-link">' . $link . '</li>';
    }
    return $items;

    Thread Starter halben

    (@halben)

    Works like a charm. Thanks. I’ll mark this thread resolve.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Add custom register link to menu’ is closed to new replies.