salmancreation

Customize Login Page Wordpress

Aug 7th, 2015
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. Change the Logo
  2. --------------------------
  3. Is the WordPress logo by default, this changes the file path of that image. Change file path and file name to your own needs.
  4.  
  5. function custom_login_logo() {
  6.     echo '<style type="text/css">h1 a { background: url('.get_bloginfo('template_directory').'/images/logo-login.gif) 50% 50% no-repeat !important; }</style>';
  7. }
  8. add_action('login_head', 'custom_login_logo');
  9.  
  10. Change the URL
  11. -----------------
  12. of where clicking that logo goes. By default it goes to WordPress.org, this will change it to your own homepage.
  13.  
  14. function change_wp_login_url() {
  15.     return bloginfo('url');
  16. }
  17. add_filter('login_headerurl', 'change_wp_login_url');
  18.  
  19. Change the Title
  20. --------------------
  21. That is, change the title attribute of the image you just replaced. This changes it to the name of your blog in the settings.
  22.  
  23. function change_wp_login_title() {
  24.     return get_option('blogname');
  25. }
  26. add_filter('login_headertitle', 'change_wp_login_title');
Advertisement
Add Comment
Please, Sign In to add comment