Ticket #12695: twentytendoc.2.diff
File twentytendoc.2.diff, 16.4 KB (added by , 14 years ago) |
---|
-
wp-content/themes/twentyten/searchform.php
1 <?php 2 /** 3 * The Search Form 4 * 5 * Displays the search form when the get_search_form() 6 * template tag is used. 7 * 8 * @package twenty-ten 9 */ 10 ?> 1 11 <form id="searchform" name="searchform" method="get" action="<?php echo home_url(); ?>"> 2 12 <div> 3 13 <label for="s"><?php _e( 'Search', 'twentyten' ); ?></label> -
wp-content/themes/twentyten/footer.php
1 <?php 2 /** 3 * The template used to display the footer 4 * 5 * Contains the closing of the id=main div and all content 6 * after. Calls sidebar-footer.php for bottom widgets 7 * 8 * @package twenty-ten 9 */ 10 ?> 1 11 </div><!-- #main --> 2 12 3 13 <div id="footer"> -
wp-content/themes/twentyten/author.php
1 <?php 2 /** 3 * The template used to display Author Archive pages 4 * 5 * @package twenty-ten 6 */ 7 ?> 1 8 <?php get_header(); ?> 2 9 3 10 <div id="container"> -
wp-content/themes/twentyten/sidebar-footer.php
1 1 <?php 2 /** 3 * The Footer widget areas 4 * 5 * @package twenty-ten 6 */ 7 ?> 8 <?php 2 9 if ( 3 10 is_active_sidebar( 'first-footer-widget-area' ) || 4 11 is_active_sidebar( 'second-footer-widget-area' ) || -
wp-content/themes/twentyten/search.php
1 <?php 2 /** 3 * The Search Results template 4 * 5 * @package twenty-ten 6 */ 7 ?> 1 8 <?php get_header(); ?> 2 9 3 10 <div id="container"> -
wp-content/themes/twentyten/404.php
1 <?php 2 /** 3 * The template for displaying a 404 page not found error 4 * 5 * @package twenty-ten 6 */ 7 ?> 1 8 <?php get_header(); ?> 2 9 3 10 <div id="container"> -
wp-content/themes/twentyten/functions.php
1 1 <?php 2 /** 3 * TwentyTen functions and definitions 4 * 5 * Sets up the theme and provides some helper functions used 6 * in other parts of the theme. All functions are pluggable 7 * 8 * @package twenty-ten 9 */ 2 10 3 // Set the content width based on the Theme CSS 11 // Set the content width based on the Theme CSS. Can be overriden 4 12 if ( ! isset( $content_width ) ) 5 13 $content_width = 640; 6 14 15 16 /** 17 /* Set up defaults for our theme. 18 * 19 * Sets up theme defaults and tells wordpress that this is a 20 * theme that will take advantage of Post Thumbnails, Custom 21 * Background, Nav Menus and automatic feed links. To 22 * override any of the settings in a child theme, create your 23 * own twentyten_init function 24 * 25 * @uses add_theme_support() 26 * 27 * @since 0.7 28 * 29 * 30 */ 31 7 32 if ( ! function_exists( 'twentyten_init' ) ) : 8 33 function twentyten_init() { 9 34 // Your Changeable header business starts here … … 90 114 endif; 91 115 add_action( 'after_setup_theme', 'twentyten_init' ); 92 116 117 /** 118 * Callback to style the header image inside the admin 119 * 120 * 121 */ 122 93 123 if ( ! function_exists( 'twentyten_admin_header_style' ) ) : 94 124 function twentyten_admin_header_style() { 95 125 ?> … … 106 136 } 107 137 endif; 108 138 109 // Get the page number 139 140 /** 141 * Returns the page number currently being browsed 142 * 143 * Returns a vertical bar followed by page and the page 144 * number. Is pluggable 145 * 146 * @since 0.7 147 * @retun string 148 */ 149 150 110 151 if ( ! function_exists( 'twentyten_get_page_number' ) ) : 111 152 function twentyten_get_page_number() { 112 153 if ( get_query_var( 'paged' ) ) … … 114 155 } 115 156 endif; 116 157 117 // Echo the page number 158 /** 159 * Echos the page number being browsed 160 * 161 * @since 0.7 162 * @uses twentyten_get_page_number 163 * 164 */ 165 118 166 if ( ! function_exists( 'twentyten_the_page_number' ) ) : 119 167 function twentyten_the_page_number() { 120 168 echo twentyten_get_page_number(); 121 169 } 122 170 endif; 123 171 124 // Control excerpt length 172 /** 173 * Sets the excerpt length to 40 charachters. Is pluggable 174 * 175 * @since 0.7 176 * @return int 177 */ 178 125 179 if ( ! function_exists( 'twentyten_excerpt_length' ) ) : 126 180 function twentyten_excerpt_length( $length ) { 127 181 return 40; … … 130 184 add_filter( 'excerpt_length', 'twentyten_excerpt_length' ); 131 185 132 186 133 // Make a nice read more link on excerpts 187 /** 188 * Sets the read more link for excerpts to something pretty 189 * 190 * @since 0.7 191 * @return string 192 * 193 */ 134 194 if ( ! function_exists( 'twentyten_excerpt_more' ) ) : 135 195 function twentyten_excerpt_more( $more ) { 136 196 return ' … <a href="'. get_permalink() . '">' . __('Continue reading <span class="meta-nav">→</span>', 'twentyten') . '</a>'; … … 139 198 add_filter( 'excerpt_more', 'twentyten_excerpt_more' ); 140 199 141 200 142 // Template for comments and pingbacks 201 /** 202 * Template for comments and pingbacks 203 * 204 * Used as a callback by wp_list_comments for displaying the 205 * comments. Is pluggable 206 * 207 * @since 0.7 208 */ 143 209 if ( ! function_exists( 'twentyten_comment' ) ) : 144 210 function twentyten_comment( $comment, $args, $depth ) { 145 211 $GLOBALS ['comment'] = $comment; ?> … … 171 237 } 172 238 endif; 173 239 174 // Remove inline styles on gallery shortcode 240 /** 241 * Remove inline styles on gallery shortcode 242 * 243 * @since 0.7 244 * @return string 245 */ 175 246 if ( ! function_exists( 'twentyten_remove_gallery_css' ) ) : 176 247 function twentyten_remove_gallery_css( $css ) { 177 248 return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css ); … … 179 250 endif; 180 251 add_filter( 'gallery_style', 'twentyten_remove_gallery_css' ); 181 252 253 /** 254 * Returns the list of catagories 255 * 256 * Returns the list of catagories based on if we are or are 257 * not browsing a catagory archive page. 258 * 259 * @uses twentyten_term_list 260 * 261 * @since 0.7 262 * @return string 263 */ 264 182 265 if ( ! function_exists( 'twentyten_cat_list' ) ) : 183 266 function twentyten_cat_list() { 184 267 return twentyten_term_list( 'category', ', ', __( 'Posted in %s', 'twentyten' ), __( 'Also posted in %s', 'twentyten' ) ); 185 268 } 186 269 endif; 187 270 271 /** 272 * Returns the list of tags 273 * 274 * Returns the list of tags based on if we are or are not 275 * browsing a tag archive page 276 * 277 * @uses twentyten_term_list 278 * 279 * @since 0.7 280 * @return string 281 */ 188 282 if ( ! function_exists( 'twentyten_tag_list' ) ) : 189 283 function twentyten_tag_list() { 190 284 return twentyten_term_list( 'post_tag', ', ', __( 'Tagged %s', 'twentyten' ), __( 'Also tagged %s', 'twentyten' ) ); 191 285 } 192 286 endif; 193 287 288 /** 289 * Returns the list of taxonomy items in multiple ways 290 * 291 * Returns the list of taxonomy items differently based on 292 * if we are browsing a term archive page or a different 293 * type of page. If browsing a term archive page and the 294 * post has no other taxonomied terms, it returns empty 295 * 296 * @since 0.7 297 * @return string 298 */ 194 299 if ( ! function_exists( 'twentyten_term_list' ) ) : 195 300 function twentyten_term_list( $taxonomy, $glue = ', ', $text = '', $also_text = '' ) { 196 301 global $wp_query, $post; … … 219 324 } 220 325 endif; 221 326 222 // Register widgetized areas 327 /** 328 * Register widgetized areas 329 * 330 * @since 0.7 331 * @uses register_sidebar 332 */ 223 333 if ( ! function_exists( 'twentyten_widgets_init' ) ) : 224 334 function twentyten_widgets_init() { 225 335 // Area 1 -
wp-content/themes/twentyten/loop.php
1 <?php 2 /** 3 * The loop that displays posts 4 * 5 * The loop displays the posts and the post content. See 6 * http://codex.wordpress.org/The_Loop to understand it and 7 * http://codex.wordpress.org/Template_Tags to understand 8 * the tags used in it. 9 * 10 * @package twenty-ten 11 */ 12 ?> 13 <?php /* Display navigation to next/previous pages when applicable */ ?> 1 14 <?php if ( $wp_query->max_num_pages > 1 ) : ?> 2 15 <div id="nav-above" class="navigation"> 3 16 <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div> … … 5 18 </div><!-- #nav-above --> 6 19 <?php endif; ?> 7 20 21 <?php /* If there are no posts to display, such as an empty archive page */ ?> 8 22 <?php if ( ! have_posts() ) : ?> 9 23 <div id="post-0" class="post error404 not-found"> 10 24 <h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1> … … 15 29 </div><!-- #post-0 --> 16 30 <?php endif; ?> 17 31 32 <?php /* Start the Loop */ ?> 18 33 <?php while ( have_posts() ) : the_post(); ?> 34 35 <?php /* How to Display posts in the Gallery Category */ ?> 19 36 <?php if ( in_category( 'Gallery' ) ) : ?> 20 37 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 21 38 <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> … … 62 79 </div><!-- #entry-utility --> 63 80 </div> 64 81 65 82 <?php /* How to display posts in the asides category */ ?> 66 83 <?php elseif ( in_category( 'asides' ) ) : ?> 67 84 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 68 85 <?php if ( is_archive() || is_search() ) : //Only display Excerpts for archives & search ?> … … 92 109 </div><!-- #entry-utility --> 93 110 </div><!-- #post-<?php the_ID(); ?> --> 94 111 95 112 <?php /* How to display all other posts */ ?> 96 113 <?php else : ?> 97 114 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 98 115 <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> … … 139 156 <?php endif; // if different categories queried ?> 140 157 <?php endwhile; ?> 141 158 159 <?php /* Display navigation to next/previous pages when applicable */ ?> 142 160 <?php if ( $wp_query->max_num_pages > 1 ) : ?> 143 161 <div id="nav-below" class="navigation"> 144 162 <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div> -
wp-content/themes/twentyten/onecolumn-page.php
1 2 1 <?php 2 /** 3 * A custom page template that doesn't use the sidebar 4 * 5 * A single column page template that can be selected from 6 * the dropdown menu on the edit page screen. 7 * 8 * @package twenty-ten 9 */ 10 ?> 11 <?php 3 12 /* 4 13 Template Name: One column, no sidebar 5 14 Description: A template with no sidebar -
wp-content/themes/twentyten/sidebar.php
1 <?php 2 /** 3 * The Sidebar containing the primary and secondary widget areas 4 * 5 * @package twenty-ten 6 */ 7 ?> 1 8 <div id="primary" class="widget-area"> 2 9 <ul class="xoxo"> 3 10 <?php if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : // begin primary widget area ?> -
wp-content/themes/twentyten/tag.php
1 <?php 2 /** 3 * The template used to display Tag Archive pages 4 * 5 * @package twenty-ten 6 */ 7 ?> 1 8 <?php get_header(); ?> 2 9 3 10 <div id="container"> -
wp-content/themes/twentyten/page.php
1 <?php 2 /** 3 * The template used to display all pages 4 * 5 * This is the template that displays all pages by default. 6 * Please note that this is the wordpress construct of pages 7 * and that other 'pages' on your wordpress site will use a 8 * different template. 9 * 10 * @package twenty-ten 11 */ 12 ?> 1 13 <?php get_header(); ?> 2 14 3 15 <div id="container"> -
wp-content/themes/twentyten/category.php
1 <?php 2 /** 3 * The template used to display Catagory Archive pages 4 * 5 * @package twenty-ten 6 */ 7 ?> 1 8 <?php get_header(); ?> 2 9 3 10 <div id="container"> -
wp-content/themes/twentyten/archive.php
1 <?php 2 /** 3 * The template used in all date based archive pages 4 * 5 * @package twenty-ten 6 */ 7 ?> 1 8 <?php get_header(); ?> 2 9 3 10 <div id="container"> -
wp-content/themes/twentyten/single.php
1 <?php 2 /** 3 * The Template used to display all single posts 4 * 5 * @package twenty-ten 6 */ 7 ?> 1 8 <?php get_header(); ?> 2 9 3 10 <div id="container"> -
wp-content/themes/twentyten/comments.php
1 <?php 2 /** 3 * The template used to display Comments 4 * 5 * The area of the page that contains both current comments 6 * and the comment form. The actual display of comments is 7 * handled by a callback to twentyten_comment which is 8 * located in the functions.php file 9 * 10 * @package twenty-ten 11 */ 12 ?> 1 13 <div id="comments"> 2 14 <?php if ( post_password_required() ) : ?> 3 15 <div class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyten' ); ?></div> -
wp-content/themes/twentyten/header.php
1 <?php 2 /** 3 * The Header for our theme. 4 * 5 * Displays all of the <head> section and everything up till <div id="main"> 6 * 7 * @package twenty-ten 8 */ 9 ?> 1 10 <!DOCTYPE html> 2 11 <html <?php language_attributes(); ?>> 3 12 <head> … … 3 12 <meta charset="<?php bloginfo( 'charset' ); ?>" /> 4 13 <title><?php 14 // Returns the title based on the type of page being viewed 5 15 if ( is_single() ) { 6 16 single_post_title(); echo ' | '; bloginfo( 'name' ); … … 37 47 // Retrieve the dimensions of the current post thumbnail -- no teensy header images for us! 38 48 $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail'); 39 49 list($src, $width, $height) = $image; 40 50 41 51 // Check if this is a post or page, if it has a thumbnail, and if it's a big one 42 if ( is_singular() && has_post_thumbnail( $post->ID ) && $width >= HEADER_IMAGE_WIDTH ) : 52 if ( is_singular() && has_post_thumbnail( $post->ID ) && $width >= HEADER_IMAGE_WIDTH ) : 43 53 // Houston, we have a new header image! 44 54 echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 45 55 else : ?> -
wp-content/themes/twentyten/attachment.php
1 <?php 2 /** 3 * The template used to display Attachment type pages 4 * 5 * @package twenty-ten 6 */ 7 ?> 1 8 <?php get_header(); ?> 2 9 3 10 <div id="container">