admin管理员组文章数量:1395780
I've enqueued a style for my WordPress login page like so:
function login_stylesheet() {
wp_enqueue_style( 'custom-login', plugins_url( 'style-login.css', __FILE__ ) );
}
add_action( 'login_enqueue_scripts', 'login_stylesheet' );
However, this doesn't enqueue the script for the password reset page.
Does anyone know how to customize the password reset page?
Update just to clarify -
The style sheet loads on the wp-login.php page:
.php
On the "Lost Your Password" page, it does not load:
.php?action=lostpassword
I've enqueued a style for my WordPress login page like so:
function login_stylesheet() {
wp_enqueue_style( 'custom-login', plugins_url( 'style-login.css', __FILE__ ) );
}
add_action( 'login_enqueue_scripts', 'login_stylesheet' );
However, this doesn't enqueue the script for the password reset page.
Does anyone know how to customize the password reset page?
Update just to clarify -
The style sheet loads on the wp-login.php page:
http://dev.yazminmedia/tresstank/wp-login.php
On the "Lost Your Password" page, it does not load:
http://dev.yazminmedia/wp-login.php?action=lostpassword
Share Improve this question edited Feb 8, 2016 at 2:50 Yazmin asked Feb 7, 2016 at 3:12 YazminYazmin 3275 silver badges15 bronze badges 3 |1 Answer
Reset to default 2Your code works fine just the way you have it - I tried it. Maybe you have another plugin that unhooks existing login_enqueue_scripts
hooks disabling yours?
Otherwise it works provided:
- The code is in a plugin;
- style-login.css file is in the same directory as the plugin;
- Some WP CSS uses
!important
; such asbody{ background }
. So, you'll need!important
for your CSS properties to override WP.
UPDATE 02/07/16:
Your updated information makes a really big difference!
The code will only work as desired on a WP single site install, not multisite. You have a multisite install using subfolders.
Notice the links in your updated question:
http://dev.yazminmedia/tresstank/wp-login.php
http://dev.yazminmedia/wp-login.php?action=lostpassword
The password reset link points to your main site not the tresstank
subsite.
It's not a plugin conflict issue, it's a WP redirect issue.
Try this link: http://yazmin.bkstest/wp-login.php then click on "Lost your password?". It will not redirect to the main site and the login style will still be applied because I use the code that can be found here https://gist.github/eteubert/293e07a49f56f300ddbb to change the default WP behavior. It's a must have for multisites. It solves issues with links in the password reset emails pointing the user to the main site (where they can't login) instead of the subsite they are a member of.
If you add the code from the above gist to your plugin your problem will most likely be solved. It works great on subdomain setups but I haven't tested it with subfolder installs.
NOTE: The code from the gist should be placed in a network activated plugin.
本文标签: cssEnqueue style for Password Reset page
版权声明:本文标题:css - Enqueue style for Password Reset page 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744684241a2619599.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
login_enqueue_script
it gets called independent of theaction
URL parameter. (WP 4.4.2, listener registered directly in functions.php and a plugin main file.) – David Commented Feb 8, 2016 at 11:58