WordPress 테마의 로고 URL 링크를 변경하는 방법은 무엇입니까? (창세기 테마 포함)
게시 됨: 2020-12-07
Crunchify에서는 변경 없이 작동하는 고품질 튜토리얼과 코드 스니펫만 게시합니다.
최근에는 프리미엄 서비스도 출시했고 프리미엄 플러그인 및 개발자 서비스도 판매하기 시작했습니다.
최근에 우리는 프리미엄 사이트( https://pro.crunchify.com
)를 변경하고 홈 사이트( https://crunchify.com
)와 일치하도록 테마를 일치시켰습니다.
그렇게 하는 동안 우리는 pro.crunchify.com의 헤더 로고 URL이 crunchify.com을 가리키도록 하는 것이 더 낫다는 것을 알게 되었습니다.
이 솔루션은 아래 질문이 있는 경우 작동합니까?
- 헤더 이미지의 URL을 변경하는 방법은 무엇입니까?
- 제네시스 샘플 테마 로고 url 변경
- 메인 헤더 이미지의 URL을 변경하는 방법은 무엇입니까?
- 헤더 이미지 링크를 URL로 변경하는 방법은 무엇입니까?
- 헤더 이미지 링크를 사용자 정의 URL로 변경하는 방법은 무엇입니까?
- 클릭 가능한 배너의 URL을 변경하는 방법은 무엇입니까?
- WordPress에서 헤더 이미지를 사용자 정의 URL에 연결하는 방법은 무엇입니까?
한동안 해결책을 찾다가 제네시스 WP 지원팀에 연락하기도 했습니다. 그러나 몇 가지 지침과 팁을 제외하고는 해결 방법을 찾지 못했습니다.

보시다시피 Genesis support
에서 명확한 해결책이 없습니다.
그래서 이 후에도 WordPress에서 클릭 가능한 헤더 링크를 변경하는 방법에 대한 솔루션을 찾고 있었습니다.
마침내 몇 번의 시행착오 끝에 헤더 로고 URL을 변경할 수 있었습니다.
다음은 코드입니다.
단순히 테마의 functions.php 파일에 넣으면 됩니다. 제 경우에는 이 코드를 pro.crunchify.com theme's function.php
파일에 넣었습니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
function crunchify_custom_logo_url ( $ crunchify_logo_html ) { $ crunchify_custom_logo_id = get_theme_mod ( 'custom_logo' ) ; // Make sure to replace your updated site URL $ crunchify_new_url = 'https://crunchify.com' ; $ crunchify_logo_html = sprintf ( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>' , esc_url ( $ crunchify_new_url ) , wp_get_attachment_image ( $ crunchify_custom_logo_id , 'full' , false , array ( 'class' = > 'custom-logo' , ) ) ) ; return $ crunchify_logo_html ; } // get_custom_logo: Returns a custom logo, linked to home unless the theme supports removing the link on the home page. add_filter ( 'get_custom_logo' , 'crunchify_custom_logo_url' ) ; |
crunchify_new_url
을 원하는 URL로 변경했는지 확인하세요.
확인하는 방법?

위의 코드가 작동하고 Google의 구조 메타데이터 요구사항을 위반하지 않는지 확인해 보겠습니다.
아래의 두 HTML 마크업을 살펴보고 비교하십시오.
WordPress 헤더 로고 URL을 변경하기 전에
1 2 3 4 5 |
< div class = "title-area" > < a href = "https://pro.crunchify.com/" class = "custom-logo-link" rel = "home" > < img width = "946" height = "198" src = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" class = "custom-logo" alt = "crunchify-pro-logo-white" srcset = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png 946w, https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white-768x161.png 768w" sizes = "(max-width: 946px) 100vw, 946px" data - attachment - id = "2386" data - permalink = "https://pro.crunchify.com/crunchify-pro-logo-white/" data - orig - file = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" data - orig - size = "946,198" data - comments - opened = "1" data - image - meta = "{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0"}" data - image - title = "crunchify-pro-logo-white" data - image - description = "" data - medium - file = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" data - large - file = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" > < / a > < p class = "site-title" > Crunchify Pro < / p > < p class = "site-description" > Premium Services , Plugins & Digital Downloads < / p > < / div > |
WordPress 헤더 로고 URL 변경 후
1 2 3 4 5 |
< div class = "title-area" > < a href = "https://crunchify.com" class = "custom-logo-link" rel = "home" > < img width = "946" height = "198" src = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" class = "custom-logo" alt = "crunchify-pro-logo-white" loading = "lazy" srcset = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png 946w, https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white-768x161.png 768w" sizes = "(max-width: 946px) 100vw, 946px" data - attachment - id = "2386" data - permalink = "https://pro.crunchify.com/crunchify-pro-logo-white/" data - orig - file = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" data - orig - size = "946,198" data - comments - opened = "1" data - image - meta = "{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0"}" data - image - title = "crunchify-pro-logo-white" data - image - description = "" data - medium - file = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" data - large - file = "https://pro.crunchify.com/wp-content/uploads/2019/04/crunchify-pro-logo-white.png" > < / a > < p class = "site-title" > Crunchify Pro < / p > < p class = "site-description" > Premium Services , Plugins & Digital Downloads < / p > < / div > |
두 구조 마크업이 모두 좋아 보이고 차이점은 로고 URL뿐입니다. 그리고 그게 다야 .

이것이 테마의 헤더 로고 URL을 변경하는 데 도움이 되기를 바랍니다.
의견 및 의견을 통해 언제든지 저희에게 알려주십시오.