在WordPress主題開發用戶中心的時候發現WordPress本身的注冊登錄頁面也是不錯的,但是很多開發者想要在這個基礎上進行改進,改進后會在整體用戶體驗度上還是有好的,如何自定義WordPress登錄頁面的LOGO圖片、鏈接及提示?
將下方代碼添加進function即可實現:
//自定義登錄頁面的LOGO圖片,其中/mytheme/img/site.png更換為你要使用的LOGO鏈接
function my_custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image:url('.get_theme_root_uri().'/mytheme/img/site.png) !important; }
</style>';
}
add_action('login_head', 'my_custom_login_logo');
//自定義登錄頁面的LOGO鏈接為首頁鏈接
add_filter('login_headerurl', create_function(false,"return get_bloginfo('url');"));
//自定義登錄頁面的LOGO提示為網站名稱
add_filter('login_headertitle', create_function(false,"return get_bloginfo('name');"));





