-
Notifications
You must be signed in to change notification settings - Fork 0
/
_SDStudio_login_page.php
73 lines (64 loc) · 2.27 KB
/
_SDStudio_login_page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/**
* Страница входа
*/
/**
* REDUX - Захват опций темы
*/
$redux = get_option( 'redux_sds_options_and_settings' );
// URL - Logo
global $logo_login_page;
$logo_login_page = null;
if (isset($redux['logo-login-page-posts-sds-options-and-settings']['url'])) {
$logo_login_page = $redux['logo-login-page-posts-sds-options-and-settings']['url'];
}
//dd($logo_login_page);
// URL - Background
global $background_login_page;
$background_login_page = null;
if (isset($redux['background-page-posts-sds-options-and-settings']['url'])) {
$background_login_page = $redux['background-page-posts-sds-options-and-settings']['url'];
}
//dd($background_login_page);
//s($redux);
/**
* --------------
*/
/* Кастомизированная страница входа в Wordpress */
if (!empty($logo_login_page)){
add_action('login_head', 'sdstudio_login_page');
}
function sdstudio_login_page() {
global $logo_login_page;
global $background_login_page;
$sdstudio_logo_signin = $logo_login_page;
$sdstudio_background_signin = $background_login_page;
?>
<style>
/* Background WordPress Login Page */
body.login {
background: linear-gradient(rgb(255, 255, 255), rgba(255, 255, 255, 0.37)), transparent url('<?php echo $sdstudio_background_signin; ?>') center center/cover no-repeat fixed;
}
/* Logo */
.login h1 a {
/* background-image: url(/wp-content/uploads/2018/10/logo-1.png) !important;*/
background-image: url(<?php echo $sdstudio_logo_signin; ?>) !important;
background-size: 150px 150px !important;
width: 150px !important;
height: 150px;
background-color: rgba(153, 152, 232, 0)white;
}
</style>
<!-- Подключение jQuery -->
<script type='text/javascript' src='/wp-includes/js/jquery/jquery.js'></script>
<!-- JS код для страницы входа wp-admin - при клике по лого переходим на главную*/ -->
<script>
jQuery( document ).ready(function( $ ) {
$('.login h1 a').on("click", function() {
window.location.href='/';
return false;
});
});
</script>
<?php
}