2012-08-05 136 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'); 
相关问题