[wp-trac] Re: [WordPress Trac] #2515: Select page to show as the front page

WordPress Trac wp-trac at lists.automattic.com
Sun Apr 16 23:44:49 GMT 2006


#2515: Select page to show as the front page
----------------------------+-----------------------------------------------
       Id:  2515            |      Status:  new                     
Component:  Administration  |    Modified:  Sun Apr 16 23:44:49 2006
 Severity:  normal          |   Milestone:  2.1                     
 Priority:  normal          |     Version:  2.0.1                   
    Owner:  ryan            |    Reporter:  ryan                    
----------------------------+-----------------------------------------------
Comment (by skeltoac):

 Canonical URL schemes suffer here because siteurl and the static page's
 natural permalink are different URLs for the same resource.

 wp_list_pages() also suffers because it includes a link to the home page
 but with a different URL.

 I use the following filter to modify this behavior. If it seems like
 correct behavior, it can be rolled into get_page_link().

 {{{
 function front_page_link($link, $id) {
         global $wp_query;
         if ( 'page' == get_option('show_on_front') && $id ==
 get_option('page_on_front') )
                 return get_settings('home');
         return $link;
 }
 add_filter('page_link', 'front_page_link', 10, 2);
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/2515>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list