hi everyone... i'm trying to filter this function in order to switch to xhtml 1.1 strict, but i haven't understood how should i write this function: should it return a string, or use an echo, or...?
sorry i'm an absolute noob on wordpress! :)
hi everyone... i'm trying to filter this function in order to switch to xhtml 1.1 strict, but i haven't understood how should i write this function: should it return a string, or use an echo, or...?
sorry i'm an absolute noob on wordpress! :)
Hey,
return the string .. take a look here:
function my_create_doctype($content) {
$content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n";
$content .= '<html xmlns="http://www.w3.org/1999/xhtml"';
return $content;
}
add_filter('thematic_create_doctype', 'my_create_doctype');
Doesn't make sense 'cause it's still the original unchanged content. So just change $content to your needs.
Cheers,
Chris
Thanks Chris! :)
This filter is giving me an internal server error. Am I missing something?
You are correct about the error. Try,
function my_create_doctype($content) {
$content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n";
$content .= '<html xmlns="http://www.w3.org/1999/xhtml"';
return $content;
}
add_filter('thematic_create_doctype', 'my_create_doctype');
Swapped out apply_filter with add_filter
good catch scott. i've edited chris' code.
This topic has been closed to new replies.