How add Placeholder to login form I need to add Placeholder property to Drupal 7 login form from template.php. Not to use a module. and also want to know how to add other attributes like Required etc.
I think it cannot be done unless using the module. You can try like this

1) Adding the hook_form_FORM_ID_alter in the module to add placeholders, required and some other form attributes.

2) In the template file you can call that form using drupal_get_form('form-id', args1, args2, etc..)

3) Finally, pass the form to the tpl file.

Example:

1) In .module

function yourModule_form_user_login_alter(&amp;$form, $form_state) {
  $form['name']['#attributes'] = array(
    'placeholder' =&gt; array (
       t('Username')
     )
  );
  $form['name']['#required'] = TRUE;
  /* Add other attributes like this*/
}


2) In template.php

$variables['login_form'] = drupal_get_form('user_login');


3) In .tpl.php

&lt;?php print render($login_form); ?&gt;


I hope this will work !!