KarSho
KarSho

Reputation: 5746

In wordpress any option to find is blog

Is there any option to check is blog page?? in Wordpress.

I need to check this option. Help me.

Thanks...

Upvotes: 1

Views: 6664

Answers (2)

anon
anon

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

Juan Rangel
Juan Rangel

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

Related Questions