2012-08-05 99 views
-4

我想刪除附加到wo-login.php中徽標的Powered by Wordpress(wordpress.org)鏈接,或者更新它,而無需編輯核心文件。是否有可能做到這一點?如何在不編輯核心WP文件的情況下移除wp.login.php中的Wordpress鏈接?

凱爾

+0

試過谷歌? 「由wordpress驅動的刪除」導致超過600萬次點擊。 – j08691 2012-08-05 15:06:58

+0

你可以在元素周圍顯示一些代碼嗎?也許將元素的顯示設置隱藏在自己的樣式表中就足夠了。 – James 2012-08-05 15:11:07

+0

@ j08691感謝您的回覆,其中大部分結果是從頁腳中刪除鏈接的鏈接,也有很多目標編輯我不想做的主要核心文件因此我的帖子在這裏 – styler 2012-08-05 15:42:21

回答

2

在你的主題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文件,使任何你想要的改變。

若要更改Wordpress.org的標題/ URL上的登錄標識的鏈接和alt文字爲您的網站,在你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'); 
+0

嘿@ Chaser324它不是CSS我擔心,我已經添加了自定義樣式,我只是想刪除附加到標識的鏈接,用於代替WordPress的標識,因爲它仍然鏈接到wordpress.org? – styler 2012-08-06 09:48:29

+0

@styler更新了我認爲你想要的內容。 – Chaser324 2012-08-06 13:06:15

1

@ Chaser324幾乎是正確的,而不是echo'ing結果需要返回結果,即

// 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'); 
相關問題