如何修改WordPress後臺的登入介面?

修改WordPress後臺的登入介面的外掛很多,但大部分都有很多我用不到的功能,會浪費資源,設定也不那麼直觀,所以決定用寫程式碼的方式來實現。

如何修改WordPress後臺的登入介面?

修改wordpress後臺介面的效果

用程式碼修改WordPress後臺的登入介面

在主題

functions。php

檔案中或者使用Code Snippets外掛新增自定義程式碼:

class Sola_Custom_Admin_Login{ private static $instance = null; public static function get_instance(){ if( self::$instance == null ){ self::$instance = new self(); } return self::$instance; } function __construct(){ add_filter( ‘login_title’, [$this, ‘login_title’], 10,2 ); add_filter( ‘login_headerurl’, [$this, ‘login_headerurl’] ); add_filter( ‘login_headertext’, [$this, ‘login_headertext’] ); add_action( ‘login_head’, [$this, ‘login_styles’] ); } // 瀏覽器標題,預設帶有WordPress字樣 function login_title( $login_title, $title ){ return $title 。‘ - ’。 get_bloginfo( ‘name’ ); } // logo的連結,預設連結到WordPress function login_headerurl(){ return site_url(); } // a標籤裡的文字,logo是a標籤的背景 function login_headertext(){ return ‘’; } // 透過css修改頁面樣式 function login_styles(){ ?>如何修改WordPress後臺的登入介面?” title=“