wordpress默认登录界面样式优化

在主题目录中functions.php文件里添加以下代码

function login_scripts() {
    wp_enqueue_style( "login-index", get_template_directory_uri() . "/css/defaultlogin.css" );
}
add_action('login_enqueue_scripts', 'login_scripts');

然后打开代码编辑工具,开始你的创作吧,至于页面有哪些class、id等自己打开浏览器后f12去查吧,下面的css只是简单修改哦

.login {
  position: relative;
  background-image: url("https://image.teelm.com/wp-content/uploads/2018/09/20180906044241rosa12.png");
  background-position: center;
  background-size: cover;
}

#login {
  position: absolute;
  left: 50%;
  margin-left: -200px;
  padding: 0;
  top: 50%;
  margin-top: -300px;
  background: #fff;
  width: 400px;
  border-radius: 4px;
  h1 {
    padding: 30px 0;
    a {
      background-image: url("https://image.teelm.com/wp-content/uploads/2018/09/20180906044241rosa12.png");
      border-radius: 50px;
      box-shadow: 0 0 10px 5px #e4eaef;
      background-size: 80% auto;
      background-position: center;
      margin: 0 auto;
      width: 80px;
      outline: none;
      height: 80px;
      transition: all .2s;
      &:hover {
        box-shadow: 0 0 10px 5px #bfd9ef
      }
    }
  }
  form {
    box-shadow: none;
    margin-top: 0;
    padding: 10px 30px 2px;
    input {
      padding: 7px 10px;
      margin-top: 8px;
      font-size: 16px;
      border-radius: 4px;
      height: 40px;
      &:focus {
        border-color: #419df5;
        box-shadow: 0 0 2px rgb(123, 184, 243);
      }
    }
    .forgetmenot {
      padding-bottom: 20px;
      padding-top: 7px;
      input[type=checkbox], input[type=radio] {
        width: 20px;
        height: 20px;
        margin-top: 0
      }
    }
    .submit {
      float: none;
      input[type=submit] {
        width: 100%;
        background: #419df5;
        border-color: #419df5;
        line-height: 40px;
        padding: 0;
        text-shadow: none;
        box-shadow: none
      }
    }
  }
  #nav, #backtoblog {
    padding-left: 30px
  }
}

@media screen and (max-width: 767px) {
  #login {
    left: 5%;
    margin-left: 0;
    width: 90%
  }
}

记得defaultlogin.css文件的路径哈,别整错了是在启用的主题的文件夹下,上面代码是保存在主题文件夹的css文件夹里的

 

© 版权声明

给TA赞助
共{{data.count}}人
人已赞助
WP教程

Wordpress添加自定义头像上传功能

2020-6-20 16:24:44

WordpressWP教程

网站被人恶意投稿了

2020-8-8 20:40:47

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索
文章目录