views:

88

answers:

2

how can I code in the following code into a wordpress site without the code causing an error with the php coding thanks.

<?xml version="1.0" encoding="utf-8" ?>
+2  A: 

One way is to include it in the last line of your php file as

echo '<?xml version="1.0" encoding="utf-8" ?>';

There's also probably a better way that someone will point out.

Ian Elliott
Why the last and not the first line? Shouldn't the xml declaration be at the top?
merkuro
If the php doesn't output anything it won't make a difference. If it does however, it should be the first line.
Ian Elliott
A: 

You can (depending on the server setup) try disabling PHP short tags. You can either do this in your .htaccess file by inserting this line:

php_value short_open_tag 0

Or by using the PHP ini_set function

ini_set ('short_open_tag', 0);

slightlymore