WordPress如何修改登陆页面LOGO

使用代码

我们可以在当前wordpress建站主题的functions.php文件中添加下面的代码:

  1. function custom_loginlogo() {
  2. echo '<style type="text/css">
  3. h1 a {background-image: url('.get_bloginfo('template_directory').'/images/login_logo.png) !important; }
  4. </style>';
  5. }
  6. add_action('login_head', 'custom_loginlogo');

接下来把你自己的LOGO文件名修改为【login_logo.png】,然后上传到当前wordpress建站主题目录下的【images】文件夹中,如果没有这个文件夹,可以自己新建一个。

接下来我们修改logo的链接,再在wordpress建站主题的functions.php文件中添加如下代码:

  1. //修改LOGO链接
  2. function custom_loginlogo_url($url) {
  3. return'https://www.zsxxfx.com/'; //在此输入你需要链接到的URL地址
  4. }
  5. add_filter( 'login_headerurl', 'custom_loginlogo_url');
  6. function custom_register_url($url) {
  7. return'https://www.zsxxfx.com/'; //在此输入你需要链接到的URL地址
  8. }
  9. add_filter( 'login_registerurl', 'custom_register_url');

链接修改为你自己的就可以了。

本站所有资源免费分享,仅供测试学习,如有帮助,欢迎打赏支持走的更远!

点击下面的广告帮助我收回服务器成本 ❤️


发表评论

(必填)

(必填)

(以便回访)