WordPress 로그인 페이지 로고 및 URL을 쉽게 변경하는 방법은 무엇입니까?
게시 됨: 2021-09-09
다음은 로그인 페이지 기본 WordPress 로고입니다.

- WordPress 로그인 로고 및 URL을 변경하는 방법은 무엇입니까?
- 로그인 양식 사용자 정의
- WordPress에서 로그인 로고를 쉽게 변경하는 방법은 무엇입니까?
기본적으로 모든 WordPress 페이지에는 기본 로고와 WordPress.org URL이 있습니다. WordPress 기본 로그인 URL 및 로고를 변경하려는 경우를 대비하여 올바른 위치에 있습니다.
시작하자:
1단계: 로그인 페이지 URL 변경
우리는 사용할 것입니다 login_headerurl
WordPress 후크는 URL 링크를 변경합니다. WordPress 로그인 페이지에서 로고의 URL을 필터링하는 데 사용됩니다. 기본적으로 이 로고는 WordPress 사이트로 연결됩니다.
functions.php 파일에 아래 코드를 넣어주세요.
1 2 3 4 5 6 7 8 |
// The “login_headerurl” filter is used to filter the URL of the logo on the WordPress login page. // By default, this logo links to the WordPress site. add_filter ( 'login_headerurl' , 'crunchify_login_link' ) ; function crunchify_login_link ( ) { // Change Logo link if you want user to redirect to other link. return home_url ( ) ; } |
2 단계. 로그인 페이지 로고 변경
우리는 사용할 것입니다 login_enqueue_scripts
WordPress 후크. 로그인 페이지에 표시할 항목을 대기열에 넣을 때 사용하는 적절한 후크입니다. 이름에도 불구하고 스크립트와 스타일을 모두 대기열에 넣는 데 사용됩니다.
functions.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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
// login_enqueue_scripts is the proper hook to use when enqueuing items that are meant to appear on the login page. // Despite the name, it is used for enqueuing both scripts and styles. add_action ( 'login_enqueue_scripts' , 'crunchify_change_login_logo' ) ; function crunchify_change_login_logo ( ) { ? > <style type ="text/css"> #login { width : 400px ; } #login h1 { background : transparent ; padding : 10px ; } #login h1 a { background : url ( 'https://cdn.crunchify.com/crunchify-logo.png' ) no-repeat center center ; background-size : 200px ; height : 200px ; margin : 0 auto ; width : 200px ; } .login form .input, .login input[type="text"] { font-size : 20px ; font-weight : 100 ; margin : 3px 7px 17px 0 ; padding : 6px 12px ; } input[type="checkbox"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime-local"]:focus, input[type="datetime"]:focus, input[type="email"]:focus, input[type="month"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="radio"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="time"]:focus, input[type="url"]:focus, input[type="week"]:focus, select:focus, textarea:focus { border : 2px solid #ddd ; box-shadow : 0 0 3px rgba ( 0, 0, 0, .3 ) ; } .wp-core-ui .button-group.button-large .button, .wp-core-ui .button.button-large { background : #b11f24 ; border : 0 ; border-radius : 0 ; box-shadow : none ; font-weight : 400 ; height : 20px ; line-height : 30px ; padding : 2px 14px 4px ; text-shadow : none ; text-transform : uppercase ; } .login #backtoblog a:hover, .login #nav a:hover, .login h1 a:hover { color : #b11f24 ; } .login .message { border-left-color : #ddd ; } input[type="checkbox"], input[type="color"], input[type="date"], input[type="datetime-local"], input[type="datetime"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="radio"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"], select, textarea { border : 2px solid #ccc ; } </style> < ? php } |
모든 변경 사항을 저장하고 사이트의 로그인 페이지로 이동하십시오. 다음과 같아야 합니다. https://crunchify.com/wp-admin/
그게 다야 축하합니다. 로그인 페이지 로고 및 URL을 성공적으로 업데이트했습니다. 이 코드를 실행하는 데 문제가 있으면 알려주십시오.