basically right now i just want to load different content for these categories:
-
- pages (mostly i'm using pages),
- home page (which is a page), and
- multi-page/post (ie, blog or blog post)
the code i've got almost works:
function page_typer() {
global $post;
if ( is_front_page() ) {
$content = 'front page';
} elseif ( is_page() ) {
$content = 'a page';
} elseif ( is_post() ) {
$content = 'a post';
} else {
$content = 'multipage';
}
echo $content;
}
except that when i use it on multipost-pages it gives me an
undefined function is_post()
error. so my primary question is how do i fix this for multipost. but then i'm also wondering if there's a better (or more inclusive, less likely to break later) way of doing this in the first place.
i really don't understand why it breaks on is_post() -- it's right in the middle of the function..... any thoughts?
thanks.