Changeset 14433 for trunk/wp-content/themes/twentyten/functions.php
- Timestamp:
- 05/04/2010 07:01:09 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyten/functions.php
r14384 r14433 105 105 // The height and width of your custom header. You can hook into the theme's own filters to change these values. 106 106 // Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values. 107 define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 108 define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 107 define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) ); 108 define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) ); 109 109 110 110 // We'll be using post thumbnails for custom header images on posts and pages. … … 228 228 */ 229 229 function twentyten_excerpt_more( $more ) { 230 return ' … <a href="'. get_permalink() . '">' . __('Continue reading <span class="meta-nav">→</span>', 'twentyten') . '</a>';230 return ' … <a href="'. get_permalink() . '">' . __('Continue reading <span class="meta-nav">→</span>', 'twentyten') . '</a>'; 231 231 } 232 232 add_filter( 'excerpt_more', 'twentyten_excerpt_more' ); … … 269 269 <?php endif; ?> 270 270 271 <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ','' ); ?></div>271 <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></div> 272 272 273 273 <div class="comment-body"><?php comment_text(); ?></div> … … 280 280 <?php else : ?> 281 281 <li class="post pingback"> 282 <p><?php _e( 'Pingback: ', 'twentyten' ); ?><?php comment_author_link(); ?><?php edit_comment_link ( __('edit', 'twentyten'), ' ', '' ); ?></p>282 <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link ( __('(Edit)', 'twentyten'), ' ' ); ?></p> 283 283 <?php endif; 284 284 } … … 295 295 // Area 1 296 296 register_sidebar( array ( 297 'name' => __( 'Primary Widget Area' 297 'name' => __( 'Primary Widget Area', 'twentyten' ), 298 298 'id' => 'primary-widget-area', 299 'description' => __( 'The primary widget area' 299 'description' => __( 'The primary widget area', 'twentyten' ), 300 300 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 301 301 'after_widget' => "</li>", … … 306 306 // Area 2 307 307 register_sidebar( array ( 308 'name' => __( 'Secondary Widget Area' 308 'name' => __( 'Secondary Widget Area', 'twentyten' ), 309 309 'id' => 'secondary-widget-area', 310 'description' => __( 'The secondary widget area' 310 'description' => __( 'The secondary widget area', 'twentyten' ), 311 311 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 312 312 'after_widget' => "</li>", … … 317 317 // Area 3 318 318 register_sidebar( array ( 319 'name' => __( 'First Footer Widget Area' 319 'name' => __( 'First Footer Widget Area', 'twentyten' ), 320 320 'id' => 'first-footer-widget-area', 321 'description' => __( 'The first footer widget area' 321 'description' => __( 'The first footer widget area', 'twentyten' ), 322 322 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 323 323 'after_widget' => "</li>", … … 328 328 // Area 4 329 329 register_sidebar( array ( 330 'name' => __( 'Second Footer Widget Area' 330 'name' => __( 'Second Footer Widget Area', 'twentyten' ), 331 331 'id' => 'second-footer-widget-area', 332 'description' => __( 'The second footer widget area' 332 'description' => __( 'The second footer widget area', 'twentyten' ), 333 333 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 334 334 'after_widget' => "</li>", … … 339 339 // Area 5 340 340 register_sidebar( array ( 341 'name' => __( 'Third Footer Widget Area' 341 'name' => __( 'Third Footer Widget Area', 'twentyten' ), 342 342 'id' => 'third-footer-widget-area', 343 'description' => __( 'The third footer widget area' 343 'description' => __( 'The third footer widget area', 'twentyten' ), 344 344 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 345 345 'after_widget' => "</li>", … … 350 350 // Area 6 351 351 register_sidebar( array ( 352 'name' => __( 'Fourth Footer Widget Area' 352 'name' => __( 'Fourth Footer Widget Area', 'twentyten' ), 353 353 'id' => 'fourth-footer-widget-area', 354 'description' => __( 'The fourth footer widget area' 354 'description' => __( 'The fourth footer widget area', 'twentyten' ), 355 355 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 356 356 'after_widget' => "</li>", … … 376 376 global $post; 377 377 $post = get_post($post); 378 $attachments = array_values( get_children( array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ));378 $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); 379 379 380 foreach ( $attachments as $k => $attachment ) 380 foreach ( $attachments as $k => $attachment ) { 381 381 if ( $attachment->ID == $post->ID ) 382 382 break; 383 384 $k = $k + 1; 385 386 if ( isset($attachments[$k]) ) { 387 return get_attachment_link($attachments[$k]->ID); 388 } else { 389 return get_permalink($post->post_parent); 390 } 391 } 383 } 384 $k++; 385 if ( isset( $attachments[ $k ] ) ) 386 return get_attachment_link( $attachments[ $k ]->ID ); 387 else 388 return get_permalink( $post->post_parent ); 389 }
Note: See TracChangeset
for help on using the changeset viewer.