Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to make a link that goes to wp-login.php for whatever domain I'm at now. Something like:

<a href="http://<script>document.write(document.domain);</script>/wp-login.php">Login</a>

But I don't know how to write / format that properly.

share|improve this question
    
What is the context in which this needs to work? –  s_ha_dum Jan 9 '13 at 17:35
    
it's in a php script –  Xue Faith Jan 9 '13 at 23:09
add comment

2 Answers

<?php wp_loginout(); ?>

Or

<a href="http://<?php bloginfo('url'); ?>/wp-login.php">Login</a>

What am I missing?

http://codex.wordpress.org/Function_Reference/wp_loginout

http://codex.wordpress.org/Function_Reference/bloginfo

share|improve this answer
add comment

If it is for the same domain something like this would also suffice:

<a href="/wp-login.php">Login</a>

But if you have the Wordpress api available the wp_loginout() function is the best available option.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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