Reputation:
How can I add the following code into a WordPress site without the code causing a PHP error?
<?xml version="1.0" encoding="utf-8" ?>
Upvotes: 0
Views: 232
Reputation: 4841
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);
Upvotes: 0
Reputation: 7686
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.
Upvotes: 2