Ticket #9015: functions.php-patch.diff
File functions.php-patch.diff, 6.7 KB (added by , 15 years ago) |
---|
-
wp-content/themes/twentyten/search.php
5 5 6 6 <?php if ( have_posts() ) : ?> 7 7 <h1 class="page-title"><?php _e( 'Search Results for: ', 'twentyten' ); ?><span><?php the_search_query(); ?></span></h1> 8 <?php include 'loop.php'; ?>8 <?php twentyten_get_loop_template(); ?> 9 9 <?php else : ?> 10 10 <div id="post-0" class="post no-results not-found"> 11 11 <h2 class="entry-title"><?php _e( 'Nothing Found', 'twentyten' ); ?></h2> -
wp-content/themes/twentyten/index.php
4 4 <div id="content"> 5 5 6 6 <?php if ( have_posts() ) : 7 include 'loop.php';7 twentyten_get_loop_template(); 8 8 else : ?> 9 9 <h2><?php _e( 'Not Found', 'twentyten' ); ?></h2> 10 10 <div class="entry-content"> -
wp-content/themes/twentyten/functions.php
3 3 // Set the content width based on the Theme CSS 4 4 $content_width = apply_filters( 'twentyten_content_width', 640 ); 5 5 6 // Enables automatic general feed link outputting 7 automatic_feed_links(); 8 6 9 // Your Changeable header business starts here 7 10 // No CSS, just IMG call 8 11 define( 'HEADER_TEXTCOLOR', ''); … … 46 49 if ( is_readable($locale_file) ) 47 50 require_once( $locale_file ); 48 51 52 // Gets the correct document title for the page 53 function twentyten_title( $sep = '|' ) { 54 if ( is_single() ) { 55 $title = sprintf( '%1$s %2$s %3$s', single_post_title( '', false ), $sep, get_bloginfo( 'name' ) ); 56 } elseif ( is_home() || is_front_page() ) { 57 $title = sprintf( '%1$s %2$s %3$s %4$s', get_bloginfo( 'name' ), $sep, get_bloginfo( 'description' ), twentyten_get_page_number($sep) ); 58 } elseif ( is_page() ) { 59 $title = sprintf( '%1$s %2$s %3$s', single_post_title( '', false ), $sep, get_bloginfo( 'name' ) ); 60 } elseif ( is_search() ) { 61 $title = sprintf( __('Search results for "%1$s" | %2$s %3$s', 'twentyten'), esc_attr(get_search_query()), twentyten_get_page_number($sep), get_bloginfo('name') ); 62 } elseif ( is_404() ) { 63 $title = sprintf( __( 'Not Found %1$s %2$s', 'twentyten' ), $sep, get_bloginfo( 'name' ) ); 64 } else { 65 $title = sprintf( '%1$s | %2$s %3$s', wp_title(''), get_bloginfo('name'), twentyten_get_page_number($sep) ); 66 } 67 68 echo apply_filters( 'twentyten_title', $title ); 69 } 70 49 71 // Get the page number 50 function twentyten_get_page_number( ) {72 function twentyten_get_page_number( $sep = '|' ) { 51 73 if ( get_query_var('paged') ) 52 echo ' | ' . __( 'Page ' , 'twentyten' ) . get_query_var('paged');74 return apply_filters( 'twentyten_get_page_number', sprintf( __( ' %s Page ' , 'twentyten' ), $sep, get_query_var('paged') ) ); 53 75 } 54 76 55 77 // Control excerpt length … … 116 138 add_filter( 'gallery_style', 'twentyten_remove_gallery_css' ); 117 139 118 140 119 // For category lists on category archives: Returns other categories except the current one (redundant) 120 function cats_meow( $glue ) { 121 $current_cat = single_cat_title( '', false ); 122 $separator = "\n"; 123 $cats = explode( $separator, get_the_category_list($separator) ); 124 foreach ( $cats as $i => $str ) { 125 if ( strstr( $str, ">$current_cat<" ) ) { 126 unset( $cats[$i] ); 127 break; 128 } 129 } 130 if ( empty($cats) ) 131 return false; 141 // Loads the loop.php template 142 function twentyten_get_loop_template() { 143 locate_template( 'loop', true ); 144 } 132 145 133 return trim( join( $glue, $cats ) );134 } // end cats_meow135 136 137 // For tag lists on tag archives: Returns other tags except the current one (redundant)138 function tag_ur_it( $glue ) {139 $current_tag = single_tag_title( '', '', false );140 $separator = "\n";141 $tags = explode( $separator, get_the_tag_list( "", "$separator", "" ) );142 foreach ( $tags as $i => $str ) {143 if ( strstr( $str, ">$current_tag<" ) ) {144 unset( $tags[$i] );145 break;146 }147 }148 if ( empty($tags) )149 return false;150 151 return trim( join( $glue, $tags ) );152 } // end tag_ur_it153 154 146 // Register widgetized areas 155 147 function twentyten_widgets_init() { 156 148 // Area 1 -
wp-content/themes/twentyten/tag.php
9 9 10 10 <?php rewind_posts(); ?> 11 11 12 <?php include 'loop.php'; ?>12 <?php twentyten_get_loop_template(); ?> 13 13 14 14 </div><!-- #content --> 15 15 </div><!-- #container --> -
wp-content/themes/twentyten/category.php
10 10 11 11 <?php rewind_posts(); ?> 12 12 13 <?php include 'loop.php'; ?>13 <?php twentyten_get_loop_template(); ?> 14 14 15 15 </div><!-- #content --> 16 16 </div><!-- #container --> -
wp-content/themes/twentyten/archive.php
17 17 18 18 <?php rewind_posts(); ?> 19 19 20 <?php include 'loop.php'; ?>20 <?php twentyten_get_loop_template(); ?> 21 21 22 22 </div><!-- #content --> 23 23 </div><!-- #container --> -
wp-content/themes/twentyten/header.php
1 1 <!DOCTYPE html> 2 2 <html <?php language_attributes(); ?>> 3 3 <head> 4 <title><?php 5 if ( is_single() ) { 6 single_post_title(); echo ' | '; bloginfo('name'); 7 } elseif ( is_home() || is_front_page() ) { 8 bloginfo('name'); echo ' | '; bloginfo('description'); twentyten_get_page_number(); 9 } elseif ( is_page() ) { 10 single_post_title(''); echo ' | '; bloginfo('name'); 11 } elseif ( is_search() ) { 12 printf(__('Search results for "%s"', 'twentyten'), esc_html($s)); twentyten_get_page_number(); echo ' | '; bloginfo('name'); 13 } elseif ( is_404() ) { 14 _e('Not Found', 'twentyten'); echo ' | '; bloginfo('name'); 15 } else { 16 wp_title(''); echo ' | '; bloginfo('name'); twentyten_get_page_number(); 17 } 18 ?></title> 4 <title><?php twentyten_title(); ?></title> 19 5 20 6 <meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> 21 7