Skip to content

Instantly share code, notes, and snippets.

@gyrus
Created July 21, 2012 13:23
Show Gist options
  • Save gyrus/3155816 to your computer and use it in GitHub Desktop.
Save gyrus/3155816 to your computer and use it in GitHub Desktop.
WordPress login link
<?php
/**
* Nice WordPress admin login link
*/
function pilau_wp_login_link() {
if ( is_user_logged_in() ) {
echo '<a href="/wp-admin/">' . __( 'Admin' ) . '</a>';
} else {
echo '<a href="' . wp_login_url() . '">' . __( 'Login' ) . '</a>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment