How to debug theme (Theme is causing pages to have no style or HTML section)

Thanks for the helpful comments, turned out it was the CiviCRM 4.7 plugin that was using a ‘base page’ and always calling page.php as the default theme template. BUT our Theme was not implementing page.php so no <html> or <head> content was being injected.

Debugged by installing XDebug on the server running on port 9000 and PHPStorm on the client (there are free ones, but this is so easy to set up!) and finally the ‘Chrome XDebug helper extension’. Sorry, no more links due to reputation 🙁

Stepping through the code showed the template hierarchy that had been implemented by the original theme developers, always bypassing page.php and calling partials/front-page.php, which is a common pattern used in some themes, e.g. Virtue.

So the resolution was to add a filter to the bottom of the ‘functions.php’ file in the Theme route and override the CiviCRM plugin action that was calling page.php:-

add_filter( 'civicrm_basepage_template', 'front_page_for_civi' );
function front_page_for_civi( $template ) {
if ($template=='page.php') {
return 'partials/front-page.php';
}
return $template;
}

Depending on the plug-in, this filter will obviously need to be called something other than civicrm_basepage_template, but hope it points people in the right direction!

Kudos to @christian-wach for originally answering this in the CiviCRM stack exchange forum.