Question: How can I implement a hook in my template file that will change the label of a field for the "group" content type from "author" to "created by"? 

![screenshot of author field](https://i.stack.imgur.com/jDhMv.png)

Answer: 
To rename the label of a field add the preprocess function [template\_preprocess\_node](http://api.drupal.org/api/drupal/modules--node--node.module/function/template_preprocess_node/7) to your *template.php* file:

```
function *YOUR THEME*_preprocess_node(&$vars){
  //Supposing that your content type name is "group"
  if($vars['type'] == 'group'){
    //Supposing that your field name is "field_txt_group"
    $vars['content']['field_txt_author']['#title'] = 'created by';
  }
}

```
I'll take a guess that there are a few different ways you can do this. 

1. Use jQuery to target the element and use text replacement. You could so something like:

```
$("#my-element").each(function () { 
  var s=$(this).text(); //get text
  $(this).text(s.replace('Author', 'created by')); //set the text to the replaced version
});   

```

Of course you will need to add on Drupal specific jQuery code depending on what version of Drupal you are using (6 or 7). See: [JavaScript in Drupal 5 and Drupal 6](http://drupal.org/node/121997) and [Managing JavaScript in Drupal 7](http://drupal.org/node/756722).

1. Try the [String Overrides](http://drupal.org/project/stringoverrides) module
2. Write a template pre-process function (template.php in your theme folder) to replace that text.