Unable to transfer php logic from node--post-esl-material.tpl.php to template.php
I think that the problem is that $content is not defined there. You have it only inside the template file but not in the preprocess hook.