| 459 | * Is the query for the 'posts page' of the site? |
| 460 | * |
| 461 | * Conditional tag used to identify the page set as 'posts page' under the Reading settings |
| 462 | * |
| 463 | * If you set a posts page for the front page of your site, this function will return |
| 464 | * true when viewing that page. |
| 465 | * |
| 466 | * @since ? |
| 467 | * |
| 468 | * @global WP_Query $wp_query Global WP_Query instance. |
| 469 | * |
| 470 | * @return bool True, if posts page of site. |
| 471 | */ |
| 472 | function is_blog_page() { |
| 473 | global $wp_query; |
| 474 | |
| 475 | if ( ! isset( $wp_query ) ) { |
| 476 | _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' ); |
| 477 | return false; |
| 478 | } |
| 479 | |
| 480 | return $wp_query->is_blog_page(); |
| 481 | } |
| 482 | |
| 483 | /** |
| 4502 | * Is the query for the posts page of the site? |
| 4503 | * |
| 4504 | * Uses is_home, get_queried_object_id and the "reading" options to determine |
| 4505 | * whether the current page is the "posts page" |
| 4506 | * |
| 4507 | * @since ? |
| 4508 | * |
| 4509 | * @return bool True, if posts page of site. |
| 4510 | */ |
| 4511 | public function is_blog_page() { |
| 4512 | // check if this is "home", whether the reading setting specify a "posts page", and if this is it |
| 4513 | if( $this->is_home() && 'page' == get_option( 'show_on_front') && get_option('page_for_posts') && ( intval( get_option('page_for_posts') ) == $this->get_queried_object_id() ) ){ |
| 4514 | return true; |
| 4515 | } |
| 4516 | return false; |
| 4517 | } |
| 4518 | |
| 4519 | /** |