I’m trying to use an is_page() conditional in WordPress to detect whether or not the current page is the blog listing page (or a blog post page actually). The conditional works fine for any other page (contact, whats-on etc) but for some reason it doesn’t work for the blog page.
Plus the actual blog post pages – URLs are www.domain.com/the-post-title format, so I can’t check for ‘blog’ in the URL from $_SERVER or anything. Any help would be hugely appreciated.
We need to check:
if this page is “page for posts”
You may need to do a combination of is_home() – if your home page is the blog
or is_single() based on the type of blog post
reference: http://codex.wordpress.org/Conditional_Tags#A_Single_Post_Page
According to this article, this is how you use these kind of conditional functions: