Ticket #2959: posts-page.diff
| File posts-page.diff, 1.6 KB (added by , 20 years ago) |
|---|
-
wp-includes/query.php
279 279 var $is_admin = false; 280 280 var $is_attachment = false; 281 281 var $is_robots = false; 282 var $is_posts_page = false; 282 283 283 284 function init_query_flags() { 284 285 $this->is_single = false; … … 300 301 $this->is_admin = false; 301 302 $this->is_attachment = false; 302 303 $this->is_robots = false; 304 $this->is_posts_page = false; 303 305 } 304 306 305 307 function init () { … … 627 629 if ( ('page' == get_option('show_on_front') ) && ( $reqpage == get_option('page_for_posts') ) ) { 628 630 $this->is_page = false; 629 631 $this->is_home = true; 632 $this->is_posts_page = true; 630 633 } else { 631 634 $q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename']))); 632 635 $page_paths = '/' . trim($q['pagename'], '/'); … … 665 668 if ( ('page' == get_option('show_on_front') ) && ( $q['page_id'] == get_option('page_for_posts') ) ) { 666 669 $this->is_page = false; 667 670 $this->is_home = true; 671 $this->is_posts_page = true; 668 672 } else { 669 673 $q['p'] = $q['page_id']; 670 674 $where = ' AND ID = '.$q['page_id']; … … 1018 1022 $category = &get_category($cat); 1019 1023 $this->queried_object = &$category; 1020 1024 $this->queried_object_id = $cat; 1025 } else if ($this->is_posts_page) { 1026 $this->queried_object = & get_page(get_option('page_for_posts')); 1027 $this->queried_object_id = $this->queried_object->ID; 1021 1028 } else if ($this->is_single) { 1022 1029 $this->queried_object = $this->post; 1023 1030 $this->queried_object_id = $this->post->ID;