Link to registration page in Wordpress
<?php echo wp_registration_url(); ?>
https://codex.wordpress.org/Function_Reference/wp_registration_url
The following will return the registration url:
<?php
echo site_url('/wp-login.php?action=register');
?>
UPDATE:
To get the registration url with a redirect to the current page use:
<?php
echo site_url('/wp-login.php?action=register&redirect_to=' . get_permalink());
?>
Since 3.6, there is now a func: http://codex.wordpress.org/Function_Reference/wp_registration_url
<?php echo wp_registration_url(); ?>
You can override it with the register_url
filter.
add_filter( 'register_url', 'custom_register_url' );
function custom_register_url( $register_url )
{
$register_url = get_permalink( $register_page_id );
return $register_url;
}
I know this is an old question, but for anyone picking it up use wp_register().
It automatically determines if you're logged in and supplies either a link to the admin section of the site, or a link to the register form.
It also respects the settings in Settings -> General -> Membership (Anyone Can Register?)