如何在不编辑核心wp文件的情况下删除wp.login.php中的Powered by Wordpress链接


How can I removed Powered by Wordpress link in wp.login.php without editing core WP files?

我想删除wo-login.php中附加在徽标上的Powered by Wordpress(Wordpress.org)链接,或者在不编辑核心文件的情况下更新它。有可能做到这一点吗?

Kyle

@Chaser324几乎是正确的,而不是回声,结果需要返回结果,即

// changing the logo link from wordpress.org to your site 
function my_login_url() { return bloginfo('url'); }
// changing the alt text on the logo to show your site name 
function my_login_title() { return get_option('blogname'); }
// calling it only on the login page
add_filter('login_headerurl', 'my_login_url');
add_filter('login_headertitle', 'my_login_title');

在主题的functions.php文件中,添加以下内容:

function my_login_css() {
    echo '<link rel="stylesheet" href="' . get_stylesheet_directory_uri() .'/path_to_dir_in_your_theme/login.css">';
}
add_action('login_head', 'my_login_css');

然后只需创建您的自定义login.css文件,即可进行您想要的任何更改。

要将登录徽标上的链接和alt文本从Wordpress.org更改为网站的标题/url,请在functions.php文件中使用以下过滤器:

// changing the logo link from wordpress.org to your site 
function my_login_url() { echo bloginfo('url'); }
// changing the alt text on the logo to show your site name 
function my_login_title() { echo get_option('blogname'); }
// calling it only on the login page
add_filter('login_headerurl', 'my_login_url');
add_filter('login_headertitle', 'my_login_title');