Created
July 26, 2013 01:24
-
-
Save teolopez/6085298 to your computer and use it in GitHub Desktop.
Custom login form and site lock down
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ---------------------------------------------------------------------------------------- | |
// Redirect all non-logged-in users to the login page (private site). Add to functions.php. | |
// ---------------------------------------------------------------------------------------- | |
function admin_redirect() { | |
if ( !is_user_logged_in()) { | |
wp_redirect( home_url('/wp-login.php/') ); | |
exit; | |
} | |
} | |
add_action('get_header', 'admin_redirect'); | |
// ------------------------------------------------ | |
// Custom login for theme and change logo url link | |
// ------------------------------------------------ | |
function childtheme_custom_login() { | |
echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('stylesheet_directory') . '/customlogin.css" />'; | |
echo '<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>'; | |
?> | |
<script type="text/javascript">$(document).ready(function(){ | |
//$('#login').css("display","none"); | |
$('#login').hide(); | |
$('#login').delay(500).fadeIn(700); | |
});</script> | |
<?php } | |
add_action('login_head', 'childtheme_custom_login'); | |
function loginpage_custom_link() { | |
$sitedomain = get_bloginfo('url'); | |
return $sitedomain; | |
} | |
add_filter('login_headerurl','loginpage_custom_link'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment