PHP opening tag showing inside html

Question

I am facing an issue with PHP opening tags. The opening tag is displayed at the starting of the file. Here is the screenshot of the source code.
enter image description here

Here is the code I use. I registered the template through the plugin. I followed this tutorial for adding the templates with the plugin.

<?php
/*
 * Template Name: Customer
 */

if ( ! is_user_logged_in() ) {
    wp_redirect( homer_url());
    exit();
}
?>

<!DOCTYPE html>
<html class="ud-for-edd-template">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <?php wp_head() ?>
</head>

I am not sure why this happens. Why the opening tag is showing before html?

Thanks in advance.

0
Raashid Din 1 month 0 Answers 11 views 0

Leave an answer