Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding image height/width support on login page

  • Loading branch information...
commit 63ca765ece609c44ce38e058929a62b07595a265 1 parent 498959d
@chrisguitarguy authored
Showing with 10 additions and 3 deletions.
  1. +8 −3 branding.php
  2. +2 −0  readme.md
View
11 branding.php
@@ -39,6 +39,8 @@ class Custom_Admin_Branding
* The args
* `login_link` - The link on the login image
* `login_image` - URI for the image above the login form
+ * `login_heigth` - Height of the image above the login form
+ * `login_width` - Width of the image above the login form
* `designer_link` - URI for the login & admin footer credit link
* `designer_anchor` - Anchor text for login & admin footer credit link
* `favicon_url` - The favicon URI, added to the admin, login, & front end
@@ -53,6 +55,8 @@ public function __construct( $args=array() )
'login_url' => 'http://wordpress.org',
'login_image' => false,
'login_title' => get_bloginfo( 'site_name' ),
+ 'login_height' => '67px',
+ 'login_width' => '326px',
'designer_url' => false,
'designer_anchor' => false,
'favicon_url' => false,
@@ -102,8 +106,10 @@ public function login_head()
if( $this->args['login_image'] )
{
printf(
- ".login h1 a { background: url(%s) no-repeat top center; }\n",
- esc_url( $this->args['login_image'] )
+ ".login h1 a { background: url(%s) no-repeat top center; height: %s; width: %s }\n",
+ esc_url( $this->args['login_image'] ),
+ $this->args['login_height'],
+ $this->args['login_width']
);
}
echo '.custom-login-branding { text-align: center; margin-top: 100px }';
@@ -161,7 +167,6 @@ public function admin_footer_text( $text )
public function admin_bar_menu( $admin_bar )
{
if( ! $this->args['remove_wp'] ) return;
- print_r( $admin_bar->get_nodes() );
$admin_bar->remove_node( 'wp-logo' );
}
View
2  readme.md
@@ -51,6 +51,8 @@ Next up, drop a few lines of code in your `functions.php`.
* `login_url` - Where would you like the logo above the login form to link? Defaults to wordpress.org
* `login_image` - What will replace the WordPress logo on the login page.
* `login_title` - The title attribute on the logo link on the login page.
+* `login_height` - Height of the login logo image.
+* `login_width` - Width of the login login logo image. ~320px is recommended. Defaults to 326px.
* `designer_url` - Used in the credit link on the login and admin pages. Your website!
* `designer_anchor` - Anchor text for the credit link.
* `favicon_url` - The favicon to be added on the login and admin pages and on the front end.
Please sign in to comment.
Something went wrong with that request. Please try again.