Try using is_page_template() instead:
http://codex.ww.wp.xz.cn/Function_Reference/is_page_template
just pass the function the name of your blog page template… I beleive its either called blog.php or page-template-blog.php according to your sites body class tags.
so if the template is “blog.php”
use: if ( is_page_template( 'blog.php' ) ) { }
I hope this helps
-greg
it is possible that the information of the page id got disturbed by the code within the template – not all codes are careful to keep the original query_string and/or $post object intact.
try to add wp_reset_query(); or wp_reset_postdata(); after the custom loop in the template.
I know this is a ridiculously old article, but it might be what I need.
I’m trying to call my blog.php template, but it’s not working.
Where would I add the wp_reset_query(); or wp_reset_postdata(); ??
I don’t really understand what the custom loop in the template means…
For the full backstory to my problem, here’s my post: http://ww.wp.xz.cn/support/topic/blogphp-template-how-to-call-for-ifelse-statement?replies=9