自定义wp-登录.php通过函数.php

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了自定义wp-登录.php通过函数.php相关的知识,希望对你有一定的参考价值。

Simply paste the following snippet of code into your theme’s functions.php file and adjust the CSS on line 4 as needed.
  1. /** ******** ******** ******** ******** ******** ******** ******** ********
  2. * TITLE: Beautify the Log-in Page
  3. * DESCRIPTION: Make the Log-in Page PRetty
  4. * 1: Change out Logo
  5. * 2: Change out URL
  6. * 3: Change out Title
  7. *
  8. * http://codex.wordpress.org/Customizing_the_Login_Form
  9. */
  10. function my_login_logo() { ?>
  11. <style type="text/css">
  12. body.login div#login h1 a {
  13. background-image: url(/wp-content/uploads/2014/07/logo-80x80.png);
  14. background-size: 80x 80px;
  15. }
  16. </style>
  17. <?php }
  18. add_action( 'login_enqueue_scripts', 'my_login_logo' );
  19.  
  20. function my_login_logo_url() {
  21. return home_url();
  22. }
  23. add_filter( 'login_headerurl', 'my_login_logo_url' );
  24.  
  25. function my_login_logo_url_title() {
  26. return 'GuitarPick';
  27. }
  28. add_filter( 'login_headertitle', 'my_login_logo_url_title' );
  29.  
  30. function no_errors_please(){
  31. return 'Please Try Again';
  32. }
  33. add_filter( 'login_errors', 'no_errors_please' );

以上是关于自定义wp-登录.php通过函数.php的主要内容,如果未能解决你的问题,请参考以下文章

php 一个自定义的try..catch包装器代码片段,用于执行模型函数,使其成为一个单行函数调用

PHP Wordpress:通过functions.php自定义wp-login.php

WP 插入 post PHP 函数和自定义字段

text 如果用户未登录,则仅显示维护模式。将maintenance.php文件添加到wp-content文件夹以自定义维护页面。

php 将自定义链接添加到使用wp_nav_menu()函数的菜单的末尾

PHP WP中的自定义字段模板 - 对应的代码段