Insert custom PHP head above in WP pages

WordPress theme should load header.php file for eacfront-endnd request, so the best place to add your custom code is in the header.php on the very top, before any HTML.