WordPress template syntax error

Posted by on 06/04/2015

I ran into a problem with wordpress, currently version 4.1.1

When I applied a page template to my home page, even using the exact same code from page.php, but with the template tag at the top. Here is the error it throws up:


"syntax error, unexpected T_STRING" ... "on line 1"

Even though this format is normal and works on every other page:


<?php

/*

Template Name: home

*/

get_header(); ?>

Here is how you get it working when the unreasonable and nonsensical error comes up:


<?php

/* Template Name:home */

?>

<?php get_header(); ?>

Comments are closed.