Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Talk:Extending the theme custom menu

From MoodleDocs

In the renderers.php file (in my project) I had to add the php tags <?php ?>, because they were missing on the original text. Fixed my problem, but I'm not sure whether I should edit the original post.