Ticket #2515: front_page.diff
| File front_page.diff, 4.0 KB (added by , 20 years ago) |
|---|
-
wp-includes/classes.php
293 293 $q['what_to_show'] = 'posts'; 294 294 } 295 295 296 if ( $this->is_home ) { 297 if ( 'page' == get_option('show_on_front') && get_option('page_on_front') ) { 298 $this->is_page = true; 299 $this->is_home = false; 300 $q['page_id'] = get_option('page_on_front'); 301 } 302 } 303 296 304 if (isset($q['page'])) { 297 305 $q['page'] = trim($q['page'], '/'); 298 306 $q['page'] = (int) $q['page']; … … 359 367 $where .= " AND post_name = '" . $q['name'] . "'"; 360 368 } else if ('' != $q['pagename']) { 361 369 $reqpage = get_page_by_path($q['pagename']); 362 $q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename']))); 363 $page_paths = '/' . trim($q['pagename'], '/'); 364 $q['pagename'] = sanitize_title(basename($page_paths)); 365 $q['name'] = $q['pagename']; 366 367 $where .= " AND (ID = '$reqpage')"; 370 371 if ( ('page' == get_option('show_on_front') ) && ( $reqpage == get_option('page_for_posts') ) ) { 372 $this->is_page = false; 373 } else { 374 $q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename']))); 375 $page_paths = '/' . trim($q['pagename'], '/'); 376 $q['pagename'] = sanitize_title(basename($page_paths)); 377 $q['name'] = $q['pagename']; 378 $where .= " AND (ID = '$reqpage')"; 379 } 368 380 } elseif ('' != $q['attachment']) { 369 381 $q['attachment'] = str_replace('%2F', '/', urlencode(urldecode($q['attachment']))); 370 382 $attach_paths = '/' . trim($q['attachment'], '/'); … … 393 405 394 406 if (($q['page_id'] != '') && (intval($q['page_id']) != 0)) { 395 407 $q['page_id'] = intval($q['page_id']); 396 $q['p'] = $q['page_id']; 397 $where = ' AND ID = '.$q['page_id']; 408 if ( ('page' == get_option('show_on_front') ) && ( $q['page_id'] == get_option('page_for_posts') ) ) { 409 $this->is_page = false; 410 } else { 411 $q['p'] = $q['page_id']; 412 $where = ' AND ID = '.$q['page_id']; 413 } 398 414 } 399 415 400 416 // If a search pattern is specified, load the posts that match -
wp-admin/options-reading.php
9 9 10 10 <div class="wrap"> 11 11 <h2><?php _e('Reading Options') ?></h2> 12 <form name="form1" method="post" action="options.php"> 12 <form name="form1" method="post" action="options.php"> 13 13 14 <fieldset class="options"> 15 <legend><?php _e('Front Page') ?></legend> 16 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 17 <tr valign="top"> 18 <th width="33%" scope="row"></th> 19 <td> 20 <p> 21 <label> 22 <input name="show_on_front" type="radio" value="posts" class="tog" <?php checked('posts', get_option('show_on_front')); ?> /> 23 <?php _e('Show the latest posts on the front page'); ?> 24 </label> 25 </p> 26 <p> 27 <label> 28 <input name="show_on_front" type="radio" value="page" class="tog" <?php checked('page', get_option('show_on_front')); ?> /> 29 <?php printf(__('Show %s on the front page'), wp_dropdown_pages("name=page_on_front&echo=0&selected=" . get_option('page_on_front'))); ?><br /> 30 <?php printf(__('Show the latest posts on %s'), wp_dropdown_pages("name=page_for_posts&echo=0&selected=" . get_option('page_for_posts'))); ?> 31 </label> 32 </p> 33 </td> 34 </tr> 35 </table> 36 </fieldset> 37 38 <fieldset class="options"> 14 39 <legend><?php _e('Blog Pages') ?></legend> 15 40 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 16 41 <tr valign="top"> … … 55 80 </p> 56 81 <p class="submit"> 57 82 <input type="hidden" name="action" value="update" /> 58 <input type="hidden" name="page_options" value="posts_per_page,what_to_show,posts_per_rss,rss_use_excerpt,blog_charset,gzipcompression " />83 <input type="hidden" name="page_options" value="posts_per_page,what_to_show,posts_per_rss,rss_use_excerpt,blog_charset,gzipcompression,show_on_front,page_on_front,page_for_posts" /> 59 84 <input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /> 60 85 </p> 61 86 </form>