How do I enable dynamic favicons in a custom theme?
Unless your theme allows for functionality to add further icons you'll need to add head link tags yourself with something like this using template_preprocess_html:

function YOURTHEME_preprocess_html(&amp;$variables) {
  $icon = [
        '#tag' =&gt; 'link',
        '#attributes' =&gt; [
            'href' =&gt; '&lt;url to your icon-52x52.png&gt;',
            'rel' =&gt; 'shortcut icon',
            'sizes' =&gt; '52x52'
        ],
    ];
    $variables['#attached']['html_head'][] = [
        $icon,
        'icon52x52
    ];
}


Or if you want to avoid adding code the metatag module as a sub module of "Metatag: favicons" to allow you to add them from the CMS
https://www.drupal.org/project/metatag