完全美化WordPress后台登陆页面指南-橘子皮

默认的wordpress后台登录界面,毫无特色可言,很平庸………

完全美化WordPress后台登陆页面指南-橘子皮

改造后的wordpress后台登陆界面,档次瞬间不一样了……..

附上代码:

  1. //去登录界面的默认图片
  2. function custom_loginlogo() {
  3. echo ‘<style type=“text/css”>
  4. h1 a {background-image: url(‘.get_bloginfo(‘template_directory’).’/images/logo.png) !important;background-size: 265px !important;width:265px !important; }
  5. </style>’;
  6. }
  7. add_action(‘login_head’, ‘custom_loginlogo’);
  8. // 修改默认登录界面的LOGO的链接地址为自己网站的地址
  9. function custom_loginlogo_url($url) {
  10. return‘http://www.dedewp.com/’; //在此输入你需要链接到的URL地址
  11. }
  12. add_filter( ‘login_headerurl’, ‘custom_loginlogo_url’);
  13. function custom_register_url($url) {
  14. return‘http://www.dedewp.com/’; //在此输入你需要链接到的URL地址
  15. }
  16. add_filter( ‘login_registerurl’, ‘custom_register_url’);
  17. // 去LOGO的title文字
  18. function custom_headertitle ( $title ) {
  19. return __( ‘WordPress一站式建站服务平台’ );
  20. }
  21. add_filter(‘login_headertitle’,’custom_headertitle’);
  22. // 添加登录注册界面的背景图片,修改登录,注册框的样式及按钮样式
  23. function custom_loginbg() {
  24. echo ‘<style type=“text/css”>body{background: url(‘.get_bloginfo(‘template_directory’).’/images/bg2.jpg) center center no-repeat;background-size: cover;}#login{position:absolute;bottom:10%;right:5%;}.login #nav{font-size:16px;}.wp-core-ui .button-group.button-large .button, .wp-core-ui .button.button-large {height: 35px;width: 100%;margin: 10px auto;line-height: 32px;padding: 0 12px 2px;}#backtoblog{display:none;}</style>’;
  25. }
  26. add_action(‘login_head’, ‘custom_loginbg’);

注释都标的很清楚,看自己的需求修改即可。