Make WordPress Core


Ignore:
Timestamp:
05/06/2010 03:04:22 AM (15 years ago)
Author:
iammattthomas
Message:

Add a home link to the navigation in twenty ten. Props iandstewart.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyten/functions.php

    r14433 r14469  
    203203        echo ' | ' . sprintf( __( 'Page %s' , 'twentyten' ), $paged );
    204204}
     205endif;
     206
     207if ( ! function_exists( 'twentyten_page_menu_args' ) ) :
     208/**
     209 * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link
     210 */
     211function twentyten_page_menu_args($args) {
     212    $args = array(
     213        'sort_column' => 'menu_order, post_title',
     214        'menu_class'  => 'menu',
     215        'echo'        => true,     
     216        'show_home' => true     
     217    );
     218    return $args;
     219}
     220add_filter('wp_page_menu_args', 'twentyten_page_menu_args');
    205221endif;
    206222
Note: See TracChangeset for help on using the changeset viewer.