IT News > トピックス > WordPress > IS関数

  • is_home() - The front page
  • is_single() - A single post
  • is_page() - A static/standalone page
  • is_category() - A category
  • is_author() - An author
  • is_date() - A year, month, or day
  • is_year() - A year
  • is_month() - A month
  • is_day() - A day
  • is_time() - An hour, minute, or second
  • is_archive() - A category, author, or date
  • is_search() - A search
  • is_404() - A 404 page
  • is_feed() - A syndication feed

さらに、is_single(), is_page(), is_category(), is_author() は、
id, name, nicename を引数の指定が可能です。

例えば、is_page()での例を下記に挙げる。

  • is_page() - True if a page is being served.
  • is_page(3) - True if a page with the ID of 3 is being served.
  • is_page(’About Me’) - True if the page title is ‘About Me’.
  • is_page(’about-me’) - True if the page nicename is ‘about-me’.
  • is_page('ニュース') - 日本語の指定も可能です。