timple-c
11/29/2017 - 8:04 PM

custom login

custom login

<?php 
function custom_login_logo() {
	
	$imagenes = get_field('fotos', 'option');
	$rand = array_rand($imagenes, 1);
	
	echo '<style type="text/css">';
	
	echo 'body.login{
		background-color:#000;
		background-position: top center;
		background-repeat: no-repeat;
		background-image:url('.$imagenes[$rand]['url'].');
		background-size:cover;
	}
	
	body.login:before{
		content:"";
		display:block;
		width:100%;
		height:100%;
		position:fixed;
		background-color:rgba(0, 0, 0, 0.5);
		z-index:0;
	}';
	
	echo '.login h1 {
		text-align: center;
		background-color: white;
		border-radius: 3px 0px 3px 0px;
	}

	.login #backtoblog a, .login #nav a {
		text-decoration: none;
		color: #FFF;
	}';
	
	echo '#login{ position:relative; z-index:10;}';
		
	echo '.login h1 a { background: url('.get_bloginfo('template_directory').'/vendor/poncho/img/logo-secretaria.svg) 50% 50% no-repeat !important; width: 303px;margin-bottom: 0px;}';
		
	echo '.login form {
		margin-top: 0px;
		margin-left: 0;
		border-radius: 0px 0px 5px 5px;
		padding: 25px 24px 45px;
		background: #fff;
		-webkit-box-shadow: 0 1px 3px rgba(0,0,0,.13);
		box-shadow: none;
	}';

	echo'</style>';
	
}
add_action('login_head', 'custom_login_logo');