Skip to main content

Customizing the wordpress login page without Plugin

Every one love to see their site totally branded. It does feel good when your users see the WordPress login page when they have to login, may be just to post a comment. Biggest problem come when you are developing for a client. Well though most of them don't know the solution is simple. You don't have to rely on any plugin just to do few modifications on the login page. You just have to add few lines to your functions.php file within your theme folder.
"This is the final result, after adding the below code to functions.php"


add_action("login_head", "my_login_head");
function my_login_head() {
echo "<style>body.login #login h1 a {
background: url('".get_bloginfo('template_url')."/styles/logo.gif')
no-repeat scroll center top transparent;
height: 49px;width: 229px;
margin-left:auto;margin-right:auto; }
body {background: url('".get_bloginfo('template_url')."/styles/bg.jpg') repeat-x; }
form {
    -moz-background-clip:border;
    -moz-background-origin:padding;
    -moz-background-size:auto auto;
    -moz-border-radius-bottomleft:0px;
    -moz-border-radius-bottomright:20px;
    -moz-border-radius-topleft:20px;
    -moz-border-radius-topright:0px;
    -moz-box-shadow:0 4px 18px #C8C8C8;
}
</style>";}

In this example we are changing the logo, background image and the form in the login page. Anything can be changed. Just go to your login page and see the style sheet. Give new css properties here and the default ones will overwritten.

Additionally you can also change the link of the login page logo which by default links to the wordpress site. Follow this post which is a nice write-up on the topic.

Comments

Popular posts from this blog

Add new avatars to your wordpress and Say Good-Bye to Mystery Man

If you are like most of the other wordpress developers out there, then you might also had this problem with the default mystery man in wordpress. You also would wanted to change the deafualt avatar of your comments with something nice. It's not that hard. It's infact very easy. Just add this to your functions.php file within your theme folder. /** * add a default-gravatar to options */ if ( !function_exists('fb_addgravatar') ) { function fb_addgravatar( $avatar_defaults ) { $myavatar = get_bloginfo('template_directory') . '/images/avatar.gif'; $avatar_defaults[$myavatar] = 'people'; $myavatar2 = get_bloginfo('template_directory') . '/images/myavatar.png'; $avatar_defaults[$myavatar2] = 'wpengineer.com'; return $avatar_defaults; } add_filter( 'avatar_defaults', 'fb_addgravatar' ); } Why this? When you can have this! Happy coding! For any queries or suggestions give a comment below!

Using WordPress Comment Meta

Comment meta is such a wonderful addition to WordPress that allow us to extend the native comment form with additional fields. This comes very handy for the one's who is trying to create review sites etc. Unfortunately there’s no documentation added on the WP codex. For the purpose of demonstration we will be doing: add a check box to the comments form. show in the WordPress comments admin whether or not the checkbox was selected. indicate in the comment notification email whether or not the checkbox was selected. Adding the checkbox to the comments form is easy. To add the checkbox to the comments form open up your themes comments.php file and paste this into the area where you need it: <label><input id="publishc" name="publishc" tabindex="90" type="checkbox" value="this is the value I want to capture" /> Whatever sentence that you want commenters to use the checkbox for</label> Now that the checkbox...

Effective Comment Management in Wordpress

Each people have their on reasons to ask for more control over the comment system, some people want to allow commenting on some posts while some want to close it on some. Some need extra features in comments like subscription or rich text. For some the problem is spam. Here is a random list of plugins that solve these issues. Plugins to combat Fight Spam: Akismet – Anti-spam is a plugin from the creators of WordPress that uses a central database of spam comments to flag spam. Requires a free API key from WordPress.com Spam Karma – Analyzes comments for spam based on a karma system in place. Bad Behavior – Prevents the spambots from even accessing your site by analyzing their HTTP requests. Did You Pass Math? – Asks the commentators a simple math question before their comments are posted. Comment Timeout – Closes comments on all old posts. Encourage Commenting BlogFollow – Shows a snippet of the commenter’s blog at the bottom of the comment. DoFollow – Removes “n...