rendering a custom entity
You could craft a variable that holds all entity fields with respect to their order and formatter settings.

/**
 * Implements hook_theme().
 */
function sponsor_theme() {
  return [
    'sponsor' =&gt; [
      'render element' =&gt; 'elements',
    ],
  ];
}

/**
 * Prepares variables for sponsor templates.
 */
function template_preprocess_sponsor(&amp;$variables) {
  // Helpful $content variable for templates.
  $variables['content'] = [];
  foreach (Element::children($variables['elements']) as $key) {
    $variables['content'][$key] = $variables['elements'][$key];
  }
}


This approach is used by core entities (node, user, comment etc).