Getting only the login field i got a user-login-block.tpl.php to customize user login block of Drupal 7. here is that code:user-login-block.tpl.php:

&lt;div id='user-login-block-container'&gt;
  &lt;div id='user-login-block-form-fields'&gt;
&lt;?php print $name; // Display username field ?&gt;
&lt;?php print $pass; // Display Password field ?&gt;
&lt;?php print $submit; // Display submit button ?&gt;
&lt;?php print $rendered; // Display hidden elements (required for successful login) ?&gt; 
  &lt;/div&gt;
  &lt;div class='links'&gt;
&lt;a href='/user/register'&gt;Create an Account&lt;/a&gt; | &lt;a href='/user/password'&gt;Forgot Password&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;


this works; here is the screenshot:

but i want to print only the username field, password field and the submit button so i can easily position them, using css, adding custom label etc.. Also delete the blue marked default drupal 7 links..  any idea? thanks..
In your theme's template.php file:

/**
 * Implements hook_form_FORM_ID_alter().
 */

function YOURTHEMENAME_form_user_login_block_alter(&amp;$form) {

    unset($form['links']);
    return;

}


In this function you have access to the form as an array. Usually I enable devel module and do a dsm($form) . In your case dsm() will not work because you need to be logged in to be able to see the output. I used var_dump($form) to see the form and used unset() function to remove the links.