How do I hide labels that have empty fields when viewing the actual node of a certain content type?
I'd really appreciate anyone's help, thanks for your time.
Another way you could achieve this is by using a custom template file that would apply to all nodes of that content type.
Make sure that node.tpl.php exists in your sites/all/themes/[mytheme]
directory first. This template must exist before other custom templates can be called.
Make a copy of your node.tpl.php and name it node--[contenttype].tpl.php
(without the brackets).
If you have the Devel module enabled, you can throw a dpm($content);
into the file to find out the name of the field you are trying to hide. Or you could look at the content type itself.
Once you have the name of the field, you can now insert this code before the print render($content);
statement:
if (empty($content['my_field'])) {
unset($content['my_field']);
}
Clear the cache, and your field will only appear if there is a value stored.