Alter the username label in the login block I want to alter the username label. Instead of username, I want to change it to User ID.
I've written the following code to perform this function, but I'm not sure how to implement it.  When I implement it in the page that contains the login block, nothing happens.
function lae_form_user_login_form_alter(&amp;$form, &amp;$form_state, $form_id) {
 $form['user-login-form']['edit-name']['#title'] = t('User ID');
}

Will this actually work? If it will, how do you implement it?
Your code needs to go inside a custom module. Assuming your module is called lae then you just need to make one or two small changes to your code:

function lae_form_user_login_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['name']['#title'] = t('User ID');
}


The edit- prefix that you get from the element's ID in HTML is actually provided by Drupal automatically, it's not the name of the key in the form array that identifies the element. Also the elements (at least for this particular form) will normally be at the root of the array so you don't want to reference $form['user-login-form']['edit-name'] (as it most likely doesn't exist).

I would advise downloading and installing the Devel module and using the dpm() function to print a nice representation of your form array to the screen, so that you can inspect it and see the correct array keys you'll need to target to effect a certain element.

// Add this to your form alter function:
dpm($form);