Get random post

Very rarely, there should be as little logic in the core helpers as possible. In this case your custom helper won’t work for the vast majority of setups which use caching in front of a Ghost instance - the first request will get a random entry and that will be cached so every subsequent request will show the same entry. You need to think of Ghost generating static pages rather than dynamic ones, if you need dynamic content for each request then it should be done client-side.