i'm trying to do something similar. there's a bunch of stuff i want to insert using thematic_belowheader(), depending on what type of page i'm on. unfortunately, i think i'll be using these for section headings (they have to be images because of the font), so the conditional tree will actually be pretty big. seems like a stupid way of doing it, but i can't come up with anything better.
anyway, as a result, i'd really like to have a robust "what type of page" function, that i can throw at anything. right now i'm just trying to parse these page types:
- front page
- post
- page
- blog/multipost/archive/etc
this is what i've got so far:
function my_belowheader() {
// Get $post if you're inside a function
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;
}
add_filter('thematic_belowheader','my_belowheader');
it works on pages & front page, but on posts or multipost pages it give me a undefined function is_post() error.
can anyone help me on this?
i'm also wondering if there's a better place to be doing page parsing than in thematic_belowheader()??
thanks.