Make WordPress Core

Ticket #12695: twentytendoc.diff

File twentytendoc.diff, 16.5 KB (added by jorbin, 14 years ago)

first pass

  • 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?>
    111    <form id="searchform" name="searchform" method="get" action="<?php echo home_url(); ?>">
    212                <div>
    313                        <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?>
    111        </div><!-- #main -->
    212
    313        <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?>
    18<?php get_header(); ?>
    29
    310                <div id="container">
  • wp-content/themes/twentyten/sidebar-footer.php

     
    11<?php
     2/**
     3 * The Footer widget areas
     4 *
     5 * @package: twenty-ten
     6 */
     7?>
     8<?php
    29        if (
    310                is_active_sidebar( 'first-footer-widget-area' )  ||
    411                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?>
    18<?php get_header(); ?>
    29
    310                <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?>
    18<?php get_header(); ?>
    29
    310        <div id="container">
  • wp-content/themes/twentyten/functions.php

     
    11<?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 */
    210
    3 // Set the content width based on the Theme CSS
     11// Set the content width based on the Theme CSS.  Can be overriden
    412if ( ! isset( $content_width ) )
    513        $content_width = 640;
    614
     15
     16/* Set up defaults for our theme.
     17 *
     18 * Sets up theme defaults and tells wordpress that this is a
     19 * theme that will take advantage of Post Thumbnails, Custom
     20 * Background, Nav Menus and automatic feed links.  To
     21 * override any of the settings in a child theme, create your
     22 * own twentyten_init function
     23 *
     24 * @uses add_theme_support()
     25 *
     26 * @since 0.7
     27 *
     28 *
     29 */
     30
    731if ( ! function_exists( 'twentyten_init' ) ) :
    832function twentyten_init() {
    933        // Your Changeable header business starts here
     
    90114endif;
    91115add_action( 'after_setup_theme', 'twentyten_init' );
    92116
     117/**
     118 * Callback to style the header image inside the admin
     119 *
     120 *
     121 */
     122
    93123if ( ! function_exists( 'twentyten_admin_header_style' ) ) :
    94124function twentyten_admin_header_style() {
    95125?>
     
    106136}
    107137endif;
    108138
    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
    110151if ( ! function_exists( 'twentyten_get_page_number' ) ) :
    111152function twentyten_get_page_number() {
    112153        if ( get_query_var( 'paged' ) )
     
    114155}
    115156endif;
    116157
    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
    118166if ( ! function_exists( 'twentyten_the_page_number' ) ) :
    119167function twentyten_the_page_number() {
    120168        echo twentyten_get_page_number();
    121169}
    122170endif;
    123171
    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
    125179if ( ! function_exists( 'twentyten_excerpt_length' ) ) :
    126180function twentyten_excerpt_length( $length ) {
    127181        return 40;
     
    130184add_filter( 'excerpt_length', 'twentyten_excerpt_length' );
    131185
    132186
    133 // Make a nice read more link on excerpts
     187/* Sets the read more link for excerpts to something pretty
     188 *
     189 * @since 0.7
     190 * @return string
     191 *
     192 */
    134193if ( ! function_exists( 'twentyten_excerpt_more' ) ) :
    135194function twentyten_excerpt_more( $more ) {
    136195        return '&nbsp;&hellip; <a href="'. get_permalink() . '">' . __('Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten') . '</a>';
     
    139198add_filter( 'excerpt_more', 'twentyten_excerpt_more' );
    140199
    141200
    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 */
    143209if ( ! function_exists( 'twentyten_comment' ) ) :
    144210function twentyten_comment( $comment, $args, $depth ) {
    145211        $GLOBALS ['comment'] = $comment; ?>
     
    171237}
    172238endif;
    173239
    174 // Remove inline styles on gallery shortcode
     240/**
     241 * Remove inline styles on gallery shortcode
     242 *
     243 * @since 0.7
     244 * @return string
     245 */
    175246if ( ! function_exists( 'twentyten_remove_gallery_css' ) ) :
    176247function twentyten_remove_gallery_css( $css ) {
    177248        return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css );
     
    179250endif;
    180251add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
    181252
     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
    182265if ( ! function_exists( 'twentyten_cat_list' ) ) :
    183266function twentyten_cat_list() {
    184267        return twentyten_term_list( 'category', ', ', __( 'Posted in %s', 'twentyten' ), __( 'Also posted in %s', 'twentyten' ) );
    185268}
    186269endif;
    187270
     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 */
    188282if ( ! function_exists( 'twentyten_tag_list' ) ) :
    189283function twentyten_tag_list() {
    190284        return twentyten_term_list( 'post_tag', ', ', __( 'Tagged %s', 'twentyten' ), __( 'Also tagged %s', 'twentyten' ) );
    191285}
    192286endif;
    193287
     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 */
    194299if ( ! function_exists( 'twentyten_term_list' ) ) :
    195300function twentyten_term_list( $taxonomy, $glue = ', ', $text = '', $also_text = '' ) {
    196301        global $wp_query, $post;
     
    219324}
    220325endif;
    221326
    222 // Register widgetized areas
     327/**
     328 * Register widgetized areas
     329 *
     330 * @since 0.7
     331 * @uses register_sidebar
     332 */
    223333if ( ! function_exists( 'twentyten_widgets_init' ) ) :
    224334function twentyten_widgets_init() {
    225335        // 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  */ ?>
    114<?php if ( $wp_query->max_num_pages > 1 ) : ?>
    215        <div id="nav-above" class="navigation">
    316                <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
     
    518        </div><!-- #nav-above -->
    619<?php endif; ?>
    720
     21<?php /* If there are no posts to display, such as an empty archive page  */ ?>
    822<?php if ( ! have_posts() ) : ?>
    923        <div id="post-0" class="post error404 not-found">
    1024                <h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>
     
    1529        </div><!-- #post-0 -->
    1630<?php endif; ?>
    1731
     32<?php /* Start the Loop  */ ?>
    1833<?php while ( have_posts() ) : the_post(); ?>
     34
     35<?php /* How to Display posts in the Gallery Category  */ ?>
    1936        <?php if ( in_category( 'Gallery' ) ) : ?>
    2037                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    2138                        <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>
     
    6279                        </div><!-- #entry-utility -->
    6380                </div>
    6481
    65 
     82<?php /* How to display posts in the asides category */ ?>
    6683        <?php elseif ( in_category( 'asides' ) ) : ?>
    6784                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    6885        <?php if ( is_archive() || is_search() ) : //Only display Excerpts for archives & search ?>
     
    92109                        </div><!-- #entry-utility -->
    93110                </div><!-- #post-<?php the_ID(); ?> -->
    94111
    95 
     112<?php /* How to display all other posts  */ ?>
    96113        <?php else : ?>
    97114                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    98115                        <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>
     
    139156        <?php endif; // if different categories queried ?>
    140157<?php endwhile; ?>
    141158
     159<?php /* Display navigation to next/previous pages when applicable  */ ?>
    142160<?php if (  $wp_query->max_num_pages > 1 ) : ?>
    143161                                <div id="nav-below" class="navigation">
    144162                                        <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
  • wp-content/themes/twentyten/onecolumn-page.php

     
    1 
    21<?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
    312/*
    413Template Name: One column, no sidebar
    514Description: 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?>
    18                <div id="primary" class="widget-area">
    29                        <ul class="xoxo">
    310<?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?>
    18<?php get_header(); ?>
    29
    310                <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?>
    113<?php get_header(); ?>
    214
    315                <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?>
    18<?php get_header(); ?>
    29
    310                <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?>
    18<?php get_header(); ?>
    29
    310                <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?>
    18<?php get_header(); ?>
    29
    310                <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?>
    113                        <div id="comments">
    214<?php if ( post_password_required() ) : ?>
    315                                <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?>
    110<!DOCTYPE html>
    211<html <?php language_attributes(); ?>>
    312<head>
     
    312        <meta charset="<?php bloginfo( 'charset' ); ?>" />
    413    <title><?php
     14        // Returns the title based on the type of page being viewed
    515        if ( is_single() ) {
    616                        single_post_title(); echo ' | '; bloginfo( 'name' );
     
    3747                                        // Retrieve the dimensions of the current post thumbnail -- no teensy header images for us!
    3848                                        $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail');
    3949                                        list($src, $width, $height) = $image;
    40                                        
     50
    4151                                        // 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 ) :
    4353                                                // Houston, we have a new header image!
    4454                                                echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    4555                                        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?>
    18<?php get_header(); ?>
    29
    310                <div id="container">