Reputation: 5746
Is there any option to check is blog page?
? in Wordpress.
I need to check this option. Help me.
Thanks...
Upvotes: 1
Views: 6664
Reputation:
To check if a page is actually a Wordpress page, use is_page()
function.
is_page( 'About Me And Joe' )
- When the Page with a post_title of "About Me And Joe" is being displayed.
is_page( 'about-me' )
- When the Page with a post_name (slug) of "about-me" is being displayed.
To check if a given page is homepage, use is_home()
function. is_home()
checks for the "Posts Page".
if (is_home()) {
//it's the homepage!
}
If you have a static page set as home, then you need:
if (is_page('Home')){
//it's the homepage again
}
Documentation: is_page()
Upvotes: 0
Reputation: 1793
Try is_home()
is_home() When the main blog page is being displayed. This is the page which shows the time based blog content of your site, so if you've set a static Page for the Front Page (see below), then this will only be true on the Page which you set as the "Posts page" in Administration > Settings > Reading. Taken from Codex
Upvotes: 5