wordpress后台登录换logo

7年前 (2017-06-20) gtj wordpress, 杂记 0评论 已收录 940℃

一、将下面代码加到主题functions.php模版文件的最后。

  1. function custom_login() {     
  2. echo '<link rel="stylesheet" tyssspe="text/css" href="' . get_bloginfo('template_directory') . '/custom_login/custom_login.css" />'; }     
  3. add_action('login_head', 'custom_login');     

二、在所用主题中新建一个名称为:custom_login 的文件夹,并在其中新建:custom_login.css及制作好的网站LOGO: logo.png也放进去。

三、将下面代码添加到custom_login.css中。

  1. /** 背景及字体 **/      
  2. html,body.login{     
  3.     background:#f2f2f2;     
  4.     font14px 'Microsoft YaHei', Arial, Lucida Grande, Tahomasans-serif;     
  5. }     
  6. /** 去掉链接下划线 **/      
  7. html a{     
  8.     text-decorationnone;     
  9. }     
  10. /** 登录DIV **/      
  11. #login {     
  12.     background:#fff;     
  13.     border1px solid #ccc;     
  14.     width:400px;     
  15.     margin40px auto 0;     
  16.     padding10px 10px 20px 10px;     
  17.     border-radius:5px;     
  18.     box-shadow:0 4px 10px -1px rgba(200, 200, 200, 0.7);     
  19. }     
  20. /** 替换logo **/      
  21. .login h1 a{     
  22.     background#fff url(logo.png) no-repeat center;     
  23.     width:400px;     
  24. }     
  25. /** 提示 **/      
  26. .updated, .login .message {     
  27.     background:#fff;     
  28.     bordernone;     
  29.     text-aligncenter;     
  30. }     
  31. /** 表单 **/      
  32. .login form {     
  33.     box-shadow:none;     
  34.     bordernone;     
  35. }     
  36. #loginform, #registerform, #lostpasswordform{     
  37.     background:transparent;     
  38.     border:none;     
  39. }     
  40. /** 按钮 **/      
  41. .button-primary,.submit .button-primary,#login form .submit input {     
  42.     width:83px;     
  43.     height:25px;     
  44.     font-weightbold;     
  45.     border:none;     
  46. }    

最后查看下效果:


参考知更鸟博客。

博主

这货来去如风,什么鬼都没留下!!!

相关推荐

嗨、骚年、快来消灭0回复。

×
订阅图标按钮
Less is more!!!