Ticket #9015: more-functions.php-patch.diff
File more-functions.php-patch.diff, 3.5 KB (added by , 15 years ago) |
---|
-
wp-content/themes/twentyten/functions.php
6 6 // Your Changeable header business starts here 7 7 // No CSS, just IMG call 8 8 define( 'HEADER_TEXTCOLOR', ''); 9 define( 'HEADER_IMAGE', '%s/images/header-1.jpg' ); // %s is theme dir uri9 define( 'HEADER_IMAGE', '%s/images/header-1.jpg' ); // %s is theme dir uri 10 10 define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) ); 11 11 define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) ); 12 12 define( 'NO_HEADER_TEXT', true ); … … 65 65 } 66 66 add_filter( 'excerpt_more', 'twentyten_new_excerpt_more' ); 67 67 68 // Enqueue the CSS stylesheets 69 function twentyten_enqueue_styles() { 70 if ( !is_admin() ) { 71 wp_enqueue_style( 'twentyten_style', get_bloginfo( 'stylesheet_url' ) ); 72 wp_enqueue_style( 'twentyten_print', get_stylesheet_directory_uri() . '/print.css', null, false, 'print' ); 73 } 74 } 75 add_action( 'init', 'twentyten_enqueue_styles' ); 68 76 77 78 // Enqueues the javascript for comment replys 79 function twentyten_enqueue_scripts() { 80 if ( is_singular() and get_site_option('thread_comments') ) 81 wp_print_scripts( 'comment-reply' ); 82 } 83 add_action( 'wp_head', 'twentyten_enqueue_scripts' ); 84 85 // Displays the post thumbnail image on singular pages. All other pages get the header image. 86 function twentyten_header_image() { 87 global $post; 88 if ( is_singular() && has_post_thumbnail( $post->ID ) ) { 89 echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 90 } else { ?> 91 <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /> 92 <?php 93 } 94 } 95 69 96 // Template for comments and pingbacks 70 97 function twentyten_list_comment( $comment, $args, $depth ) { 71 98 $GLOBALS['comment'] = $comment; ?> -
wp-content/themes/twentyten/header.php
20 20 <meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> 21 21 22 22 <link rel="profile" href="http://gmpg.org/xfn/11" /> 23 <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" /> 24 <link rel="stylesheet" type="text/css" media="print" href="<?php bloginfo('stylesheet_directory'); ?>/print.css" /> 25 26 <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> 27 23 28 24 <?php wp_head(); ?> 29 25 30 26 <link rel="alternate" type="application/rss+xml" href="<?php bloginfo( 'rss2_url' ); ?>" title="<?php printf( esc_attr__( '%s latest posts', 'twentyten' ), esc_html( get_bloginfo('name') ) ); ?>" /> … … 42 38 <div id="site-title"><span><a href="<?php echo home_url('/'); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></div> 43 39 <div id="site-description"><?php bloginfo( 'description' ); ?></div> 44 40 45 <?php 46 if ( is_singular() && has_post_thumbnail( $post->ID ) ) { 47 echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 48 } else { ?> 49 <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /> 50 <?php } ?> 41 <?php twentyten_header_image(); ?> 51 42 </div><!-- #branding --> 52 43 53 44 <div id="access">