Hello Sam,
You can try to add your code in a block. Go to Admin Panel >> Content Boxes. Click +Add a Box-> choose type of box 'Smarty' and put your code below. But you need to add smarty tag. See example:
Code:Only registered members can view the code.