I have created a custom content type and added some fields to it. I want to theme one of the fields which I added from the "Manage Fields" section.

I want to remove the div wrappers when the form field is rendered.

Is there any form field specific theme function which I can override in template.php and make my changes?

1 Answer 1


If you want to do it in template.php, you would use THEMENAME_field__fieldname__contenttypename() as theme function. If you like to use a special template file, you would name it field--fieldname--contenttypename.tpl.php and put it into yours themes template folder.

All needed information can be found in Drupal API documentation.

  • I want to theme the form field in Add Form and not while viewing the page. I tried this before and was not working.
    – Villie
    Oct 31, 2015 at 13:35
  • Note: If you are making changes to the node edit forms, and are using an admin theme. It is the admin theme template.php that you will need to change.
    – Collins
    Oct 31, 2015 at 13:53
  • @Villie sorry, you are right, that is indeed for outputting the fields value. Maybe this question was answered before here?
    – suit4
    Oct 31, 2015 at 16:01
  • And another one here.
    – suit4
    Oct 31, 2015 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.