Hi andrewwinkler
This snippet of code in that topic is meant for article view of com_content, not custom code section in in template.
You should add into the override for article: /templates/your_template/html/com_content/article/default.php
If this file doesn't exist now, you can override by copying the base file in T4 plugin:
/plugins/system/t4/themes/base/html/com_content/article/
and paste into above path of template.
Regards