Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Enqueue stylesheet in plugin for wp-login.php

You can do this two way.But I prefer to go for the second way.You need to put this code in your plugins file.

First way:

function my_loginlcustomization() {
  echo '<style type="text/css">
    h1 a {
     background-image: url(' . plugin_dir_url( __FILE__ ).'/login/logo.png) !important;
    }
  </style>';
}
add_action('login_head', 'my_loginlcustomization');

Second Way(I prefer):

function my_loginlcustomization() {

wp_register_style('custom_loginstyle', plugins_url('/css/login.css', __FILE__));
wp_enqueue_style("custom_loginstyle");
}
add_action('login_head', 'my_loginlcustomization'); 

Thanks

Related Posts:

  1. How do I force wp_enqueue_scripts to load at the END of ?
  2. How to laod wp_enqueue_style to another header i created my self
  3. How do I make my plugin load before the headers are output so I can redirect wordpress?
  4. how to include other plugins css files in a shortcode?
  5. How can I dequeue a Plugin Stylesheet?
  6. Add code into on a per page/post basis
  7. How to load different css file for different pages
  8. How to remove/hide action links cluttering under specific plugins’ names
  9. Get info (url) from already enqueued styles
  10. Change My Basket text in the header of WooCommerce Artificer theme
  11. wp_enqueue_style in Plugin [duplicate]
  12. Plugin throws up 404 on front-end when when enqueuing style with filetime
  13. How to send “Location” header on plugin form submit event?
  14. Meteor Slides as header only for homepage and Use featured image of each page as header for respective pages
  15. How can I enqueue a style only when a particular widget is active?
  16. Login with email (WP Modal Login)
  17. Prevent CSS/JS loading when plugin is not used
  18. Strip HTML comments from plugins in header/footer
  19. wp_enqueue_style specifics for overwriting plugin styles
  20. filemtime() warning when enqueuing style within plugin
  21. send_headers don’t work on wordpress multisite
  22. WordPress login with Phone Number [closed]
  23. How to enqueue a theme style-sheet to my admin settings page?
  24. adding meta data using plugin to top of head
  25. Is it possible to enqueue CSS files from plugin before theme’s CSS files?
  26. How to make wp_enqueue_style and wp_enqueue_script work only on custom post type
  27. How to remove style and js from theme and add your own style and js where shortcode is used?
  28. WordPress Redirect Not Working – AJAX Callback Response Not Picked Up
  29. Is there an earlier hook than login_head or login_enqueue_scripts?
  30. Headers already sent when I try to add headers via a shortcode
  31. WordPress repository forbids me call wp-load.php in non-WordPress file
  32. Making a plugin only available on the front-end for the logged in super admin
  33. Show an image in my header.php
  34. Headers Content-Security-Policy CSP Major Issue
  35. How to remove plug in styles for WPForms Lite [closed]
  36. How to debug error message: Cannot modify header information
  37. Redirect already logged in users away from a page to a specific page base on user role
  38. Can’t catch enqueued style
  39. Adding Font Awesome to WP Plugin
  40. Object method calling for global $wpdb in header.php
  41. What does making sure “that your theme is WordPress header and footer tag enabled” mean?
  42. Know which plugin is calling JS in wp_head()?
  43. My single.php page does not show the related data to the post which is clicked
  44. How to add CSS via custom plugin?
  45. Get ‘Headers already sent’ error for the plugin I am creating when I try to login
  46. Custom Login Page — wp_signon Headers Already Sent?
  47. wp_enqueue_style for plugin options page
  48. Adding Plugin Assets to Header
  49. Content-Security-Policy Headers are there and showing the correct settings, but still getting a refused connection
  50. echo get_option in header template
  51. wp_enqueue_style on template_redirect level?
  52. Possibility to login without password
  53. Custom plugin – load enqueue only for this plugin
  54. dynamic name of the style for wp_enqueue_style
  55. plugin enqueue style on all pages
  56. is it possible to hook every page style?
  57. Dequeue, Unregister, Remove Action – Not Working on Plugin
  58. Deregister scripts from plugin
  59. Cannot access WP admin because plugin returns 204
  60. force jQuery to load in the head
  61. Edit page header on a custom plugin
  62. How do i ‘deactivate’ a plugin only on a certain page template?
  63. how would I include some html in the header section of a wordpress plugin? I get an error
  64. How do I fill the Home Description?
  65. Hook for plugin to insert into entry-meta
  66. sliding/fading header plugin or approach suggestion
  67. How to make a slider hearder?
  68. Edit all $wp_scripts at once to $in_footer = false
  69. Edit all $wp_scripts at once to $in_footer = false
  70. Load CSS before Theme CSS
  71. Enqueue css to a third-party plugin template
  72. Prevent WordPress from sending set-cookie http header
  73. wordpress plugin add page when activate
  74. How to add styles to a submenu page?
  75. wp_set_password() does not work!
  76. Why can I not deregister my style and script on custom post type?
  77. How to change the width of certain paragraph or header blocks?
  78. Modifying server’s response to API endpoint
  79. How to fix shifting header after installing speed / cache plugins?
  80. Cannot modify header information – headers already sent during plugin activation
  81. Debug in WP backend
  82. How to overlay a webcomic plugin on top of a header image?
  83. Set Content-Type header in do_parse_request filter
  84. Primary Menu doesn’t show because of w3 cache
  85. Insert Plugin on a custom page
  86. Redirect default login page to a custom page [duplicate]
  87. How to add php stylesheet to admin section instead of admin_head hook
  88. Problems with installing and deleting plugins
  89. WordPress include scripts and style in plugin page
  90. Change text “My Basket” in woocommerce artificer theme
  91. WordPress repository forbids me call wp-load.php in non-WordPress file
  92. plugin’s script and style enqueing not working on Thesis
  93. How to link that “logged in” in “you must be logged in to post a comment” with custom login page on WordPress?
  94. How to validate password length in wordpress
  95. Cannot modify header information – headers already sent by
  96. Footer option is missing in Customiser
  97. No Google Analytics code rendered in the header?
  98. Can’t change login logo & css – older plugin data blocking?
  99. Gravityforms login form custom redirect if form not submitted
  100. Frontend Enqueued Files in the Backend
Categories plugins Tags headers, plugins, wp-enqueue-style, wp-login-form
Undefined property: stdClass::$id when retriving term ID
The excerpt doesn’t add Read more

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress