wordpress development - page judgment

is_single()

Determine whether the article page

is_single ( '2') / is_single (2)
determines whether the specific article (id = 2) of the page

is_single ( ")
to determine whether a specific article (titled Beef Stew) Pages

is_single ( 'beef-stew')
determines whether the specific article (Slug as beef-stew) Pages

is_single (array (2, 'beef -stew', 'Irish Stew'));
determining whether a particular article (id = 2 or slug = 'beef-stew' or entitled Irish Stew) Pages

======================================

is_page () whether the page page (Page)

======================================

is_category () whether category pages (Category / Archive)

======================================

is_author () whether the author of the page

======================================

is_tag () whether Tag archive page

is_date () is the specified date archive page

is_year () is the specified year archive page

is_month () is the specified month archive page

is_day () is the specified date archive page

is_time () is the specified time archive page

is_archive () whether the archive page

is_search () whether the search results page

is_404 () whether the "404: Not Found" error page

Whether is_paged () Home / Category / Archive page is displayed in multiple pages

Published 65 original articles · won praise 3 · views 50000 +

Guess you like

Origin blog.csdn.net/web_orange/article/details/77426885