Changeset 13885
- Timestamp:
- 03/29/2010 10:03:15 PM (15 years ago)
- Location:
- trunk/wp-content/themes/twentyten
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyten/404.php
r13128 r13885 1 <?php 2 /** 3 * The template for displaying 404 pages (Not Found) 4 * 5 * @package WordPress 6 * @subpackage Twenty Ten 7 * @since 3.0.0 8 */ 9 ?> 10 1 11 <?php get_header(); ?> 2 12 -
trunk/wp-content/themes/twentyten/archive.php
r13816 r13885 1 <?php 2 /** 3 * Generic template for Archive pages. 4 * 5 * Used to display archive-type pages if nothing more specific matches a query. 6 * For example, puts together date-based pages if no date.php file exists. 7 * 8 * Learn more: http://codex.wordpress.org/Template_Hierarchy 9 * 10 * @package WordPress 11 * @subpackage Twenty Ten 12 * @since 3.0.0 13 */ 14 ?> 15 1 16 <?php get_header(); ?> 2 17 -
trunk/wp-content/themes/twentyten/attachment.php
r13830 r13885 1 <?php 2 /** 3 * The template used to display attachments. 4 * 5 * @package WordPress 6 * @subpackage Twenty Ten 7 * @since 3.0.0 8 */ 9 ?> 10 1 11 <?php get_header(); ?> 2 12 -
trunk/wp-content/themes/twentyten/author.php
r13816 r13885 1 <?php 2 /** 3 * The template used to display Author Archive pages 4 * 5 * @package WordPress 6 * @subpackage Twenty Ten 7 * @since 3.0.0 8 */ 9 ?> 10 1 11 <?php get_header(); ?> 2 12 -
trunk/wp-content/themes/twentyten/category.php
r13830 r13885 1 <?php 2 /** 3 * The template used to display Category Archive pages 4 * 5 * @package WordPress 6 * @subpackage Twenty Ten 7 * @since 3.0.0 8 */ 9 ?> 10 1 11 <?php get_header(); ?> 2 12 … … 14 24 * called loop-category.php and that will be used instead. 15 25 */ 16 26 get_template_part( 'loop', 'category' ); 17 27 ?> 18 28 -
trunk/wp-content/themes/twentyten/comments.php
r13830 r13885 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 WordPress 11 * @subpackage Twenty Ten 12 * @since 3.0.0 13 */ 14 ?> 15 1 16 <div id="comments"> 2 17 <?php if ( post_password_required() ) : ?> -
trunk/wp-content/themes/twentyten/footer.php
r13720 r13885 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 WordPress 9 * @subpackage Twenty Ten 10 * @since 3.0.0 11 */ 12 ?> 13 1 14 </div><!-- #main --> 2 15 -
trunk/wp-content/themes/twentyten/functions.php
r13830 r13885 1 1 <?php 2 3 // Set the content width based on the Theme CSS 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 WordPress 9 * @subpackage Twenty Ten 10 * @since 3.0.0 11 */ 12 13 /** 14 * Set the content width based on the Theme CSS. Can be overriden 15 * 16 * Used in attachment.php to set the width of images. Should 17 * be equal to the width set for .onecolumn #content in style.css 18 */ 4 19 if ( ! isset( $content_width ) ) 5 20 $content_width = 640; 6 21 7 22 if ( ! function_exists( 'twentyten_init' ) ) : 23 /** 24 * Set up defaults for our theme. 25 * 26 * Sets up theme defaults and tells wordpress that this is a 27 * theme that will take advantage of Post Thumbnails, Custom 28 * Background, Nav Menus and automatic feed links. To 29 * override any of the settings in a child theme, create your 30 * own twentyten_init function 31 * 32 * @uses add_theme_support() 33 */ 8 34 function twentyten_init() { 35 // This theme allows users to set a custom background 36 add_custom_background(); 37 38 // This theme styles the visual editor with editor-style.css to match the theme style. 39 add_editor_style(); 40 41 // This theme needs post thumbnails 42 add_theme_support( 'post-thumbnails' ); 43 44 // This theme uses wp_nav_menu() 45 add_theme_support( 'nav-menus' ); 46 47 // We'll be using them for custom header images on posts and pages 48 // so we want them to be 940 pixels wide by 198 pixels tall (larger images will be auto-cropped to fit) 49 set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); 50 51 // Add default posts and comments RSS feed links to head 52 add_theme_support( 'automatic-feed-links' ); 53 54 // Make theme available for translation 55 // Translations can be filed in the /languages/ directory 56 load_theme_textdomain( 'twentyten', TEMPLATEPATH . '/languages' ); 57 58 $locale = get_locale(); 59 $locale_file = TEMPLATEPATH . "/languages/$locale.php"; 60 if ( is_readable( $locale_file ) ) 61 require_once( $locale_file ); 62 9 63 // Your Changeable header business starts here 10 64 // No CSS, just IMG call 11 65 define( 'HEADER_TEXTCOLOR', '' ); 12 66 define( 'HEADER_IMAGE', '%s/images/headers/forestfloor.jpg' ); // %s is theme dir uri 67 68 // Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values 13 69 define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) ); 14 70 define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) ); 71 15 72 define( 'NO_HEADER_TEXT', true ); 16 73 17 74 add_custom_image_header( '', 'twentyten_admin_header_style' ); 18 75 // and thus ends the changeable header business 76 77 // Default custom headers. %s is a placeholder for the theme template directory 19 78 20 79 register_default_headers( array ( … … 60 119 ) 61 120 ) ); 62 63 add_custom_background();64 65 // This theme styles the visual editor with editor-style.css to match the theme style.66 add_editor_style();67 68 // This theme needs post thumbnails69 add_theme_support( 'post-thumbnails' );70 71 // This theme uses wp_nav_menu()72 add_theme_support( 'nav-menus' );73 74 // We'll be using them for custom header images on posts and pages75 // so we want them to be 940 pixels wide by 198 pixels tall (larger images will be auto-cropped to fit)76 set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );77 78 // Add default posts and comments RSS feed links to head79 add_theme_support( 'automatic-feed-links' );80 81 // Make theme available for translation82 // Translations can be filed in the /languages/ directory83 load_theme_textdomain( 'twentyten', TEMPLATEPATH . '/languages' );84 85 $locale = get_locale();86 $locale_file = TEMPLATEPATH . "/languages/$locale.php";87 if ( is_readable( $locale_file ) )88 require_once( $locale_file );89 121 } 90 122 endif; … … 92 124 93 125 if ( ! function_exists( 'twentyten_admin_header_style' ) ) : 126 /** 127 * Callback to style the header image inside the admin 128 */ 94 129 function twentyten_admin_header_style() { 95 130 ?> … … 107 142 endif; 108 143 109 // Get the page number110 144 if ( ! function_exists( 'twentyten_get_page_number' ) ) : 145 /** 146 * Returns the page number currently being browsed 147 * 148 * Returns a vertical bar followed by page and the page 149 * number. Is pluggable 150 * 151 * @retun string 152 */ 111 153 function twentyten_get_page_number() { 112 154 if ( get_query_var( 'paged' ) ) … … 115 157 endif; 116 158 117 // Echo the page number118 159 if ( ! function_exists( 'twentyten_the_page_number' ) ) : 160 /** 161 * Echos the page number being browsed 162 * 163 * @uses twentyten_get_page_number 164 * 165 */ 119 166 function twentyten_the_page_number() { 120 167 echo twentyten_get_page_number(); … … 122 169 endif; 123 170 124 // Control excerpt length125 171 if ( ! function_exists( 'twentyten_excerpt_length' ) ) : 172 /** 173 * Sets the excerpt length to 40 charachters. Is pluggable 174 * 175 * @return int 176 */ 126 177 function twentyten_excerpt_length( $length ) { 127 178 return 40; … … 130 181 add_filter( 'excerpt_length', 'twentyten_excerpt_length' ); 131 182 132 133 // Make a nice read more link on excerpts134 183 if ( ! function_exists( 'twentyten_excerpt_more' ) ) : 184 /** 185 * Sets the read more link for excerpts to something pretty 186 * 187 * @return string 188 * 189 */ 135 190 function twentyten_excerpt_more( $more ) { 136 191 return ' … <a href="'. get_permalink() . '">' . __('Continue reading <span class="meta-nav">→</span>', 'twentyten') . '</a>'; … … 139 194 add_filter( 'excerpt_more', 'twentyten_excerpt_more' ); 140 195 141 142 // Template for comments and pingbacks143 196 if ( ! function_exists( 'twentyten_comment' ) ) : 197 /** 198 * Template for comments and pingbacks 199 * 200 * Used as a callback by wp_list_comments for displaying the 201 * comments. Is pluggable 202 * 203 */ 144 204 function twentyten_comment( $comment, $args, $depth ) { 145 205 $GLOBALS ['comment'] = $comment; ?> … … 172 232 endif; 173 233 174 // Remove inline styles on gallery shortcode175 234 if ( ! function_exists( 'twentyten_remove_gallery_css' ) ) : 235 /** 236 * Remove inline styles on gallery shortcode 237 * 238 * @return string 239 */ 176 240 function twentyten_remove_gallery_css( $css ) { 177 241 return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css ); … … 181 245 182 246 if ( ! function_exists( 'twentyten_cat_list' ) ) : 247 /** 248 * Returns the list of categories 249 * 250 * Returns the list of categories based on if we are or are 251 * not browsing a category archive page. 252 * 253 * @uses twentyten_term_list 254 * 255 * @return string 256 */ 183 257 function twentyten_cat_list() { 184 258 return twentyten_term_list( 'category', ', ', __( 'Posted in %s', 'twentyten' ), __( 'Also posted in %s', 'twentyten' ) ); … … 187 261 188 262 if ( ! function_exists( 'twentyten_tag_list' ) ) : 263 /** 264 * Returns the list of tags 265 * 266 * Returns the list of tags based on if we are or are not 267 * browsing a tag archive page 268 * 269 * @uses twentyten_term_list 270 * 271 * @return string 272 */ 189 273 function twentyten_tag_list() { 190 274 return twentyten_term_list( 'post_tag', ', ', __( 'Tagged %s', 'twentyten' ), __( 'Also tagged %s', 'twentyten' ) ); … … 193 277 194 278 if ( ! function_exists( 'twentyten_term_list' ) ) : 279 /** 280 * Returns the list of taxonomy items in multiple ways 281 * 282 * Returns the list of taxonomy items differently based on 283 * if we are browsing a term archive page or a different 284 * type of page. If browsing a term archive page and the 285 * post has no other taxonomied terms, it returns empty 286 * 287 * @return string 288 */ 195 289 function twentyten_term_list( $taxonomy, $glue = ', ', $text = '', $also_text = '' ) { 196 290 global $wp_query, $post; … … 220 314 endif; 221 315 222 // Register widgetized areas223 316 if ( ! function_exists( 'twentyten_widgets_init' ) ) : 317 /** 318 * Register widgetized areas 319 * 320 * @uses register_sidebar 321 */ 224 322 function twentyten_widgets_init() { 225 323 // Area 1 -
trunk/wp-content/themes/twentyten/header.php
r13872 r13885 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 WordPress 8 * @subpackage Twenty Ten 9 * @since 3.0.0 10 */ 11 ?> 12 1 13 <!DOCTYPE html> 2 14 <html <?php language_attributes(); ?>> -
trunk/wp-content/themes/twentyten/index.php
r13816 r13885 1 <?php 2 3 /** 4 * The main template file 5 * 6 * This is the most generic template file in a WordPress theme 7 * and one of the two required files for a theme (the other being style.css). 8 * It is used to display a page when nothing more specific matches a query. 9 * E.g., it puts together the home page when no home.php file exists. 10 * Learn more: http://codex.wordpress.org/Template_Hierarchy 11 * 12 * @package WordPress 13 * @subpackage Twenty Ten 14 * @since 3.0.0 15 */ 16 17 ?> 18 1 19 <?php get_header(); ?> 2 20 -
trunk/wp-content/themes/twentyten/loop.php
r13830 r13885 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 WordPress 11 * @subpackage Twenty Ten 12 * @since 3.0.0 13 */ 14 ?> 15 16 <?php /* Display navigation to next/previous pages when applicable */ ?> 1 17 <?php if ( $wp_query->max_num_pages > 1 ) : ?> 2 18 <div id="nav-above" class="navigation"> … … 6 22 <?php endif; ?> 7 23 24 <?php /* If there are no posts to display, such as an empty archive page */ ?> 8 25 <?php if ( ! have_posts() ) : ?> 9 26 <div id="post-0" class="post error404 not-found"> … … 16 33 <?php endif; ?> 17 34 35 <?php /* Start the Loop */ ?> 18 36 <?php while ( have_posts() ) : the_post(); ?> 37 38 <?php /* How to Display posts in the Gallery Category */ ?> 19 39 <?php if ( in_category( 'Gallery' ) ) : ?> 20 40 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> … … 63 83 </div> 64 84 65 85 <?php /* How to display posts in the asides category */ ?> 66 86 <?php elseif ( in_category( 'asides' ) ) : ?> 67 87 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> … … 93 113 </div><!-- #post-<?php the_ID(); ?> --> 94 114 95 115 <?php /* How to display all other posts */ ?> 96 116 <?php else : ?> 97 117 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> … … 140 160 <?php endwhile; ?> 141 161 162 <?php /* Display navigation to next/previous pages when applicable */ ?> 142 163 <?php if ( $wp_query->max_num_pages > 1 ) : ?> 143 164 <div id="nav-below" class="navigation"> -
trunk/wp-content/themes/twentyten/onecolumn-page.php
r13818 r13885 1 <?php 2 /** 3 * Template Name: One column, no sidebar 4 * 5 * A custom page template without sidebar. 6 * Selectable from a dropdown menu on the edit page screen. 7 * 8 * @package WordPress 9 * @subpackage Twenty Ten 10 * @since 3.0.0 11 */ 12 ?> 1 13 2 <?php 3 /* 4 Template Name: One column, no sidebar 5 Description: A template with no sidebar 6 */ 7 get_header(); ?> 14 <?php get_header(); ?> 8 15 9 16 <div id="container" class="onecolumn"> -
trunk/wp-content/themes/twentyten/page.php
r13846 r13885 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 WordPress 11 * @subpackage Twenty Ten 12 * @since 3.0.0 13 */ 14 ?> 15 1 16 <?php get_header(); ?> 2 17 -
trunk/wp-content/themes/twentyten/search.php
r13816 r13885 1 <?php 2 /** 3 * The Search Results template 4 * 5 * @package WordPress 6 * @subpackage Twenty Ten 7 * @since 3.0.0 8 */ 9 ?> 10 1 11 <?php get_header(); ?> 2 12 -
trunk/wp-content/themes/twentyten/searchform.php
r13128 r13885 1 <?php 2 /** 3 * The Search Form 4 * 5 * Optional file that allows displaying a custom search form 6 * when the get_search_form() template tag is used. 7 * 8 * @package WordPress 9 * @subpackage Twenty Ten 10 * @since 3.0.0 11 */ 12 ?> 13 1 14 <form id="searchform" name="searchform" method="get" action="<?php echo home_url(); ?>"> 2 15 <div> -
trunk/wp-content/themes/twentyten/sidebar-footer.php
r13830 r13885 1 <?php 2 /** 3 * The Footer widget areas 4 * 5 * @package WordPress 6 * @subpackage Twenty Ten 7 * @since 3.0.0 8 */ 9 ?> 10 1 11 <?php 2 12 if ( -
trunk/wp-content/themes/twentyten/sidebar.php
r13720 r13885 1 <?php 2 /** 3 * The Sidebar containing the primary and secondary widget areas 4 * 5 * @package WordPress 6 * @subpackage Twenty Ten 7 * @since 3.0.0 8 */ 9 ?> 10 1 11 <div id="primary" class="widget-area"> 2 12 <ul class="xoxo"> -
trunk/wp-content/themes/twentyten/single.php
r13830 r13885 1 <?php 2 /** 3 * The Template used to display all single posts 4 * 5 * @package WordPress 6 * @subpackage Twenty Ten 7 * @since 3.0.0 8 */ 9 ?> 10 1 11 <?php get_header(); ?> 2 12 -
trunk/wp-content/themes/twentyten/tag.php
r13830 r13885 1 <?php 2 /** 3 * The template used to display Tag Archive pages 4 * 5 * @package WordPress 6 * @subpackage Twenty Ten 7 * @since 3.0.0 8 */ 9 ?> 10 1 11 <?php get_header(); ?> 2 12
Note: See TracChangeset
for help on using the changeset viewer.