PHP file open tag output before doctype tag

I am trying to figure out the best way to troubleshoot what is going on here. I am using wordpress version 4.9.8 on PHP 7.2.2. (local install, not wordpress.com)

The site is still in development and i have noticed that right before the doctype tag a standard php tag was output first.

Currently on site pages:

<?php<!DOCTYPE html>
<html lang=”en-US”>

What i’m expecting:

<!DOCTYPE html>
<html lang=”en-US”>

Currently on admin pages:

<?php<!DOCTYPE html>
<!–[if IE 8]>
<html xmlns=”http://www.w3.org/1999/xhtml” class=”ie8 wp-toolbar” lang=”en-US”>

What i’m expecting:

<!DOCTYPE html>
<!–[if IE 8]>
<html xmlns=”http://www.w3.org/1999/xhtml” class=”ie8 wp-toolbar” lang=”en-US”>

I feel like it is coming from the template file, but i’m not getting any errors thrown. Is there a way i can test and see what is triggering the extra

<?php

to be output to the html content?

Read more here:: PHP file open tag output before doctype tag

Leave a Reply

Your email address will not be published. Required fields are marked *