<?php
function current_page_type() {
if (is_category()) {
return 'category';
} elseif (is_tag()) {
return 'tag';
} elseif (is_404()) {
return '404';
} elseif (is_post_type_archive()) {
return 'archive';
} elseif (is_page()) {
return 'page';
} else {
return 0;
}
}
?>
You can of course adjust the above code to echo the results when you call the function.