code: def custom_render_template(template_name_or_list, **context):
      
      response_str = render_template(
          functools.reduce(lambda x, y: x + [os.path.join('custom', y), y],
                           to_list(template_name_or_list), []),
          **context
      )
      if hasattr(g, 'status_code'):
          status_code = g.status_code
      else:
          status_code = 200
      return response_str, status_code
docs: Try to render templates in the custom folder first,
      if no custom templates, try the theme's default ones.