簡體   English   中英

如何將新的 div 添加到 wordpress 管理登錄面板

[英]How to add new div to wordpress admin login panel

我想以某種方式將一個新的 div 插入管理登錄面板。

函數.php

<?php
add_action( 'login_enqueue_scripts', function () {
    
wp_enqueue_script( 'jquery' );

wp_enqueue_style( 'amereo-login-styles', get_theme_file_uri('login-styles.css'), [], false );
wp_enqueue_script( 'amereo-login-scripts', get_theme_file_uri('login-scripts.js'), [], false, true);
} );

登錄樣式.css

    #login a {
    height:80px;
    width:80px;
    background-repeat: no-repeat;
    background-image: url("images/login_logo.png");
    }
    
    body.login
    {
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    background-size:cover;
    background-image: url("images/1.png");
    cursor: url('images/cursor.png'), default;
    }

login-scripts.js //empty

(很可能我只能編輯 wp-login.php 文件,我想使用我的主題獲得這種效果)這可能嗎?

您可以為此使用login_init掛鈎。

add_action('login_init', function(){
    ?>
        <div>
            Your custom div
        </div>
    <?php

});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM