@@ -12,13 +12,13 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
| 14 | 14 | <header class="entry-header"> |
| 15 | - <?php if ( has_post_thumbnail() && ! post_password_required() && ! is_attachment() ) : ?> |
|
| 15 | + <?php if (has_post_thumbnail() && ! post_password_required() && ! is_attachment()) : ?> |
|
| 16 | 16 | <div class="entry-thumbnail"> |
| 17 | 17 | <?php the_post_thumbnail(); ?> |
| 18 | 18 | </div> |
| 19 | 19 | <?php endif; ?> |
| 20 | 20 | |
| 21 | - <?php if ( is_single() ) : ?> |
|
| 21 | + <?php if (is_single()) : ?> |
|
| 22 | 22 | <h1 class="entry-title"><?php the_title(); ?></h1> |
| 23 | 23 | <?php else : ?> |
| 24 | 24 | <h1 class="entry-title"> |
@@ -28,11 +28,11 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | <div class="entry-meta"> |
| 30 | 30 | <?php twentythirteen_entry_meta(); ?> |
| 31 | - <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> |
|
| 31 | + <?php edit_post_link(__('Edit', 'twentythirteen'), '<span class="edit-link">', '</span>'); ?> |
|
| 32 | 32 | </div><!-- .entry-meta --> |
| 33 | 33 | </header><!-- .entry-header --> |
| 34 | 34 | |
| 35 | - <?php if ( is_search() ) : // Only display Excerpts for Search ?> |
|
| 35 | + <?php if (is_search()) : // Only display Excerpts for Search ?> |
|
| 36 | 36 | <div class="entry-summary"> |
| 37 | 37 | <?php the_excerpt(); ?> |
| 38 | 38 | </div><!-- .entry-summary --> |
@@ -40,25 +40,25 @@ discard block |
||
| 40 | 40 | <div class="entry-content"> |
| 41 | 41 | <?php |
| 42 | 42 | /* translators: %s: Name of current post */ |
| 43 | - the_content( sprintf( |
|
| 44 | - __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentythirteen' ), |
|
| 45 | - the_title( '<span class="screen-reader-text">', '</span>', false ) |
|
| 46 | - ) ); |
|
| 43 | + the_content(sprintf( |
|
| 44 | + __('Continue reading %s <span class="meta-nav">→</span>', 'twentythirteen'), |
|
| 45 | + the_title('<span class="screen-reader-text">', '</span>', false) |
|
| 46 | + )); |
|
| 47 | 47 | |
| 48 | - wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); |
|
| 48 | + wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">'.__('Pages:', 'twentythirteen').'</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); |
|
| 49 | 49 | ?> |
| 50 | 50 | </div><!-- .entry-content --> |
| 51 | 51 | <?php endif; ?> |
| 52 | 52 | |
| 53 | 53 | <footer class="entry-meta"> |
| 54 | - <?php if ( comments_open() && ! is_single() ) : ?> |
|
| 54 | + <?php if (comments_open() && ! is_single()) : ?> |
|
| 55 | 55 | <div class="comments-link"> |
| 56 | - <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a comment', 'twentythirteen' ) . '</span>', __( 'One comment so far', 'twentythirteen' ), __( 'View all % comments', 'twentythirteen' ) ); ?> |
|
| 56 | + <?php comments_popup_link('<span class="leave-reply">'.__('Leave a comment', 'twentythirteen').'</span>', __('One comment so far', 'twentythirteen'), __('View all % comments', 'twentythirteen')); ?> |
|
| 57 | 57 | </div><!-- .comments-link --> |
| 58 | 58 | <?php endif; // comments_open() ?> |
| 59 | 59 | |
| 60 | - <?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?> |
|
| 61 | - <?php get_template_part( 'author-bio' ); ?> |
|
| 60 | + <?php if (is_single() && get_the_author_meta('description') && is_multi_author()) : ?> |
|
| 61 | + <?php get_template_part('author-bio'); ?> |
|
| 62 | 62 | <?php endif; ?> |
| 63 | 63 | </footer><!-- .entry-meta --> |
| 64 | 64 | </article><!-- #post --> |
@@ -20,9 +20,12 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | <?php if ( is_single() ) : ?> |
| 22 | 22 | <h1 class="entry-title"><?php the_title(); ?></h1> |
| 23 | - <?php else : ?> |
|
| 23 | + <?php else { |
|
| 24 | + : ?> |
|
| 24 | 25 | <h1 class="entry-title"> |
| 25 | - <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> |
|
| 26 | + <a href="<?php the_permalink(); |
|
| 27 | +} |
|
| 28 | +?>" rel="bookmark"><?php the_title(); ?></a> |
|
| 26 | 29 | </h1> |
| 27 | 30 | <?php endif; // is_single() ?> |
| 28 | 31 | |
@@ -36,7 +39,8 @@ discard block |
||
| 36 | 39 | <div class="entry-summary"> |
| 37 | 40 | <?php the_excerpt(); ?> |
| 38 | 41 | </div><!-- .entry-summary --> |
| 39 | - <?php else : ?> |
|
| 42 | + <?php else { |
|
| 43 | + : ?> |
|
| 40 | 44 | <div class="entry-content"> |
| 41 | 45 | <?php |
| 42 | 46 | /* translators: %s: Name of current post */ |
@@ -44,6 +48,7 @@ discard block |
||
| 44 | 48 | __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentythirteen' ), |
| 45 | 49 | the_title( '<span class="screen-reader-text">', '</span>', false ) |
| 46 | 50 | ) ); |
| 51 | +} |
|
| 47 | 52 | |
| 48 | 53 | wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); |
| 49 | 54 | ?> |
@@ -13,43 +13,43 @@ |
||
| 13 | 13 | * If the current post is protected by a password and the visitor has not yet |
| 14 | 14 | * entered the password we will return early without loading the comments. |
| 15 | 15 | */ |
| 16 | -if ( post_password_required() ) |
|
| 16 | +if (post_password_required()) |
|
| 17 | 17 | return; |
| 18 | 18 | ?> |
| 19 | 19 | |
| 20 | 20 | <div id="comments" class="comments-area"> |
| 21 | 21 | |
| 22 | - <?php if ( have_comments() ) : ?> |
|
| 22 | + <?php if (have_comments()) : ?> |
|
| 23 | 23 | <h2 class="comments-title"> |
| 24 | 24 | <?php |
| 25 | - printf( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'twentythirteen' ), |
|
| 26 | - number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); |
|
| 25 | + printf(_nx('One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'twentythirteen'), |
|
| 26 | + number_format_i18n(get_comments_number()), '<span>'.get_the_title().'</span>'); |
|
| 27 | 27 | ?> |
| 28 | 28 | </h2> |
| 29 | 29 | |
| 30 | 30 | <ol class="comment-list"> |
| 31 | 31 | <?php |
| 32 | - wp_list_comments( array( |
|
| 32 | + wp_list_comments(array( |
|
| 33 | 33 | 'style' => 'ol', |
| 34 | 34 | 'short_ping' => true, |
| 35 | 35 | 'avatar_size' => 74, |
| 36 | - ) ); |
|
| 36 | + )); |
|
| 37 | 37 | ?> |
| 38 | 38 | </ol><!-- .comment-list --> |
| 39 | 39 | |
| 40 | 40 | <?php |
| 41 | 41 | // Are there comments to navigate through? |
| 42 | - if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : |
|
| 42 | + if (get_comment_pages_count() > 1 && get_option('page_comments')) : |
|
| 43 | 43 | ?> |
| 44 | 44 | <nav class="navigation comment-navigation" role="navigation"> |
| 45 | - <h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'twentythirteen' ); ?></h1> |
|
| 46 | - <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentythirteen' ) ); ?></div> |
|
| 47 | - <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentythirteen' ) ); ?></div> |
|
| 45 | + <h1 class="screen-reader-text section-heading"><?php _e('Comment navigation', 'twentythirteen'); ?></h1> |
|
| 46 | + <div class="nav-previous"><?php previous_comments_link(__('← Older Comments', 'twentythirteen')); ?></div> |
|
| 47 | + <div class="nav-next"><?php next_comments_link(__('Newer Comments →', 'twentythirteen')); ?></div> |
|
| 48 | 48 | </nav><!-- .comment-navigation --> |
| 49 | 49 | <?php endif; // Check for comment navigation ?> |
| 50 | 50 | |
| 51 | - <?php if ( ! comments_open() && get_comments_number() ) : ?> |
|
| 52 | - <p class="no-comments"><?php _e( 'Comments are closed.' , 'twentythirteen' ); ?></p> |
|
| 51 | + <?php if ( ! comments_open() && get_comments_number()) : ?> |
|
| 52 | + <p class="no-comments"><?php _e('Comments are closed.', 'twentythirteen'); ?></p> |
|
| 53 | 53 | <?php endif; ?> |
| 54 | 54 | |
| 55 | 55 | <?php endif; // have_comments() ?> |
@@ -13,8 +13,9 @@ |
||
| 13 | 13 | * If the current post is protected by a password and the visitor has not yet |
| 14 | 14 | * entered the password we will return early without loading the comments. |
| 15 | 15 | */ |
| 16 | -if ( post_password_required() ) |
|
| 16 | +if ( post_password_required() ) { |
|
| 17 | 17 | return; |
| 18 | +} |
|
| 18 | 19 | ?> |
| 19 | 20 | |
| 20 | 21 | <div id="comments" class="comments-area"> |
@@ -9,22 +9,22 @@ |
||
| 9 | 9 | ?> |
| 10 | 10 | |
| 11 | 11 | <header class="page-header"> |
| 12 | - <h1 class="page-title"><?php _e( 'Nothing Found', 'twentythirteen' ); ?></h1> |
|
| 12 | + <h1 class="page-title"><?php _e('Nothing Found', 'twentythirteen'); ?></h1> |
|
| 13 | 13 | </header> |
| 14 | 14 | |
| 15 | 15 | <div class="page-content"> |
| 16 | - <?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?> |
|
| 16 | + <?php if (is_home() && current_user_can('publish_posts')) : ?> |
|
| 17 | 17 | |
| 18 | - <p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentythirteen' ), admin_url( 'post-new.php' ) ); ?></p> |
|
| 18 | + <p><?php printf(__('Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentythirteen'), admin_url('post-new.php')); ?></p> |
|
| 19 | 19 | |
| 20 | - <?php elseif ( is_search() ) : ?> |
|
| 20 | + <?php elseif (is_search()) : ?> |
|
| 21 | 21 | |
| 22 | - <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with different keywords.', 'twentythirteen' ); ?></p> |
|
| 22 | + <p><?php _e('Sorry, but nothing matched your search terms. Please try again with different keywords.', 'twentythirteen'); ?></p> |
|
| 23 | 23 | <?php get_search_form(); ?> |
| 24 | 24 | |
| 25 | 25 | <?php else : ?> |
| 26 | 26 | |
| 27 | - <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'twentythirteen' ); ?></p> |
|
| 27 | + <p><?php _e('It seems we can’t find what you’re looking for. Perhaps searching can help.', 'twentythirteen'); ?></p> |
|
| 28 | 28 | <?php get_search_form(); ?> |
| 29 | 29 | |
| 30 | 30 | <?php endif; ?> |
@@ -22,9 +22,12 @@ |
||
| 22 | 22 | <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with different keywords.', 'twentythirteen' ); ?></p> |
| 23 | 23 | <?php get_search_form(); ?> |
| 24 | 24 | |
| 25 | - <?php else : ?> |
|
| 25 | + <?php else { |
|
| 26 | + : ?> |
|
| 26 | 27 | |
| 27 | - <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'twentythirteen' ); ?></p> |
|
| 28 | + <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'twentythirteen' ); |
|
| 29 | +} |
|
| 30 | +?></p> |
|
| 28 | 31 | <?php get_search_form(); ?> |
| 29 | 32 | |
| 30 | 33 | <?php endif; ?> |
@@ -20,12 +20,12 @@ discard block |
||
| 20 | 20 | * A sidebar in the footer? Yep. You can can customize |
| 21 | 21 | * your footer with four columns of widgets. |
| 22 | 22 | */ |
| 23 | - get_sidebar( 'footer' ); |
|
| 23 | + get_sidebar('footer'); |
|
| 24 | 24 | ?> |
| 25 | 25 | |
| 26 | 26 | <div id="site-info"> |
| 27 | - <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"> |
|
| 28 | - <?php bloginfo( 'name' ); ?> |
|
| 27 | + <a href="<?php echo esc_url(home_url('/')); ?>" title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>" rel="home"> |
|
| 28 | + <?php bloginfo('name'); ?> |
|
| 29 | 29 | </a> |
| 30 | 30 | </div><!-- #site-info --> |
| 31 | 31 | |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | * @since Twenty Ten 1.0 |
| 38 | 38 | */ |
| 39 | - do_action( 'twentyten_credits' ); ?> |
|
| 40 | - <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyten' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyten' ); ?>"><?php printf( __( 'Proudly powered by %s.', 'twentyten' ), 'WordPress' ); ?></a> |
|
| 39 | + do_action('twentyten_credits'); ?> |
|
| 40 | + <a href="<?php echo esc_url(__('https://wordpress.org/', 'twentyten')); ?>" title="<?php esc_attr_e('Semantic Personal Publishing Platform', 'twentyten'); ?>"><?php printf(__('Proudly powered by %s.', 'twentyten'), 'WordPress'); ?></a> |
|
| 41 | 41 | </div><!-- #site-generator --> |
| 42 | 42 | |
| 43 | 43 | </div><!-- #colophon --> |
@@ -11,38 +11,38 @@ discard block |
||
| 11 | 11 | ?><!DOCTYPE html> |
| 12 | 12 | <html <?php language_attributes(); ?>> |
| 13 | 13 | <head> |
| 14 | -<meta charset="<?php bloginfo( 'charset' ); ?>" /> |
|
| 14 | +<meta charset="<?php bloginfo('charset'); ?>" /> |
|
| 15 | 15 | <title><?php |
| 16 | 16 | /* |
| 17 | 17 | * Print the <title> tag based on what is being viewed. |
| 18 | 18 | */ |
| 19 | 19 | global $page, $paged; |
| 20 | 20 | |
| 21 | - wp_title( '|', true, 'right' ); |
|
| 21 | + wp_title('|', true, 'right'); |
|
| 22 | 22 | |
| 23 | 23 | // Add the blog name. |
| 24 | - bloginfo( 'name' ); |
|
| 24 | + bloginfo('name'); |
|
| 25 | 25 | |
| 26 | 26 | // Add the blog description for the home/front page. |
| 27 | - $site_description = get_bloginfo( 'description', 'display' ); |
|
| 28 | - if ( $site_description && ( is_home() || is_front_page() ) ) |
|
| 27 | + $site_description = get_bloginfo('description', 'display'); |
|
| 28 | + if ($site_description && (is_home() || is_front_page())) |
|
| 29 | 29 | echo " | $site_description"; |
| 30 | 30 | |
| 31 | 31 | // Add a page number if necessary: |
| 32 | - if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) |
|
| 33 | - echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ) ); |
|
| 32 | + if (($paged >= 2 || $page >= 2) && ! is_404()) |
|
| 33 | + echo esc_html(' | '.sprintf(__('Page %s', 'twentyten'), max($paged, $page))); |
|
| 34 | 34 | |
| 35 | 35 | ?></title> |
| 36 | 36 | <link rel="profile" href="http://gmpg.org/xfn/11" /> |
| 37 | -<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> |
|
| 38 | -<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> |
|
| 37 | +<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" /> |
|
| 38 | +<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> |
|
| 39 | 39 | <?php |
| 40 | 40 | /* |
| 41 | 41 | * We add some JavaScript to pages with the comment form |
| 42 | 42 | * to support sites with threaded comments (when in use). |
| 43 | 43 | */ |
| 44 | - if ( is_singular() && get_option( 'thread_comments' ) ) |
|
| 45 | - wp_enqueue_script( 'comment-reply' ); |
|
| 44 | + if (is_singular() && get_option('thread_comments')) |
|
| 45 | + wp_enqueue_script('comment-reply'); |
|
| 46 | 46 | |
| 47 | 47 | /* |
| 48 | 48 | * Always have wp_head() just before the closing </head> |
@@ -59,36 +59,36 @@ discard block |
||
| 59 | 59 | <div id="header"> |
| 60 | 60 | <div id="masthead"> |
| 61 | 61 | <div id="branding" role="banner"> |
| 62 | - <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?> |
|
| 62 | + <?php $heading_tag = (is_home() || is_front_page()) ? 'h1' : 'div'; ?> |
|
| 63 | 63 | <<?php echo $heading_tag; ?> id="site-title"> |
| 64 | 64 | <span> |
| 65 | - <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a> |
|
| 65 | + <a href="<?php echo esc_url(home_url('/')); ?>" title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>" rel="home"><?php bloginfo('name'); ?></a> |
|
| 66 | 66 | </span> |
| 67 | 67 | </<?php echo $heading_tag; ?>> |
| 68 | - <div id="site-description"><?php bloginfo( 'description' ); ?></div> |
|
| 68 | + <div id="site-description"><?php bloginfo('description'); ?></div> |
|
| 69 | 69 | |
| 70 | 70 | <?php |
| 71 | 71 | // Compatibility with versions of WordPress prior to 3.4. |
| 72 | - if ( function_exists( 'get_custom_header' ) ) { |
|
| 72 | + if (function_exists('get_custom_header')) { |
|
| 73 | 73 | /* |
| 74 | 74 | * We need to figure out what the minimum width should be for our featured image. |
| 75 | 75 | * This result would be the suggested width if the theme were to implement flexible widths. |
| 76 | 76 | */ |
| 77 | - $header_image_width = get_theme_support( 'custom-header', 'width' ); |
|
| 77 | + $header_image_width = get_theme_support('custom-header', 'width'); |
|
| 78 | 78 | } else { |
| 79 | 79 | $header_image_width = HEADER_IMAGE_WIDTH; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | // Check if this is a post or page, if it has a thumbnail, and if it's a big one |
| 83 | - if ( is_singular() && current_theme_supports( 'post-thumbnails' ) && |
|
| 84 | - has_post_thumbnail( $post->ID ) && |
|
| 85 | - ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) && |
|
| 86 | - $image[1] >= $header_image_width ) : |
|
| 83 | + if (is_singular() && current_theme_supports('post-thumbnails') && |
|
| 84 | + has_post_thumbnail($post->ID) && |
|
| 85 | + ( /* $src, $width, $height */ $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'post-thumbnail') ) && |
|
| 86 | + $image[1] >= $header_image_width) : |
|
| 87 | 87 | // Houston, we have a new header image! |
| 88 | - echo get_the_post_thumbnail( $post->ID ); |
|
| 89 | - elseif ( get_header_image() ) : |
|
| 88 | + echo get_the_post_thumbnail($post->ID); |
|
| 89 | + elseif (get_header_image()) : |
|
| 90 | 90 | // Compatibility with versions of WordPress prior to 3.4. |
| 91 | - if ( function_exists( 'get_custom_header' ) ) { |
|
| 91 | + if (function_exists('get_custom_header')) { |
|
| 92 | 92 | $header_image_width = get_custom_header()->width; |
| 93 | 93 | $header_image_height = get_custom_header()->height; |
| 94 | 94 | } else { |
@@ -96,15 +96,15 @@ discard block |
||
| 96 | 96 | $header_image_height = HEADER_IMAGE_HEIGHT; |
| 97 | 97 | } |
| 98 | 98 | ?> |
| 99 | - <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $header_image_width ); ?>" height="<?php echo esc_attr( $header_image_height ); ?>" alt="" /> |
|
| 99 | + <img src="<?php header_image(); ?>" width="<?php echo esc_attr($header_image_width); ?>" height="<?php echo esc_attr($header_image_height); ?>" alt="" /> |
|
| 100 | 100 | <?php endif; ?> |
| 101 | 101 | </div><!-- #branding --> |
| 102 | 102 | |
| 103 | 103 | <div id="access" role="navigation"> |
| 104 | 104 | <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?> |
| 105 | - <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div> |
|
| 105 | + <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e('Skip to content', 'twentyten'); ?>"><?php _e('Skip to content', 'twentyten'); ?></a></div> |
|
| 106 | 106 | <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?> |
| 107 | - <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?> |
|
| 107 | + <?php wp_nav_menu(array('container_class' => 'menu-header', 'theme_location' => 'primary')); ?> |
|
| 108 | 108 | </div><!-- #access --> |
| 109 | 109 | </div><!-- #masthead --> |
| 110 | 110 | </div><!-- #header --> |
@@ -25,12 +25,14 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | // Add the blog description for the home/front page. |
| 27 | 27 | $site_description = get_bloginfo( 'description', 'display' ); |
| 28 | - if ( $site_description && ( is_home() || is_front_page() ) ) |
|
| 29 | - echo " | $site_description"; |
|
| 28 | + if ( $site_description && ( is_home() || is_front_page() ) ) { |
|
| 29 | + echo " | $site_description"; |
|
| 30 | + } |
|
| 30 | 31 | |
| 31 | 32 | // Add a page number if necessary: |
| 32 | - if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) |
|
| 33 | - echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ) ); |
|
| 33 | + if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { |
|
| 34 | + echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ) ); |
|
| 35 | + } |
|
| 34 | 36 | |
| 35 | 37 | ?></title> |
| 36 | 38 | <link rel="profile" href="http://gmpg.org/xfn/11" /> |
@@ -41,8 +43,9 @@ discard block |
||
| 41 | 43 | * We add some JavaScript to pages with the comment form |
| 42 | 44 | * to support sites with threaded comments (when in use). |
| 43 | 45 | */ |
| 44 | - if ( is_singular() && get_option( 'thread_comments' ) ) |
|
| 45 | - wp_enqueue_script( 'comment-reply' ); |
|
| 46 | + if ( is_singular() && get_option( 'thread_comments' ) ) { |
|
| 47 | + wp_enqueue_script( 'comment-reply' ); |
|
| 48 | + } |
|
| 46 | 49 | |
| 47 | 50 | /* |
| 48 | 51 | * Always have wp_head() just before the closing </head> |
@@ -15,12 +15,12 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | ?> |
| 17 | 17 | |
| 18 | -<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> |
|
| 18 | +<?php if (have_posts()) while (have_posts()) : the_post(); ?> |
|
| 19 | 19 | |
| 20 | - <?php if ( ! empty( $post->post_parent ) ) : ?> |
|
| 21 | - <p class="page-title"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'Return to %s', 'twentyten' ), strip_tags( get_the_title( $post->post_parent ) ) ) ); ?>" rel="gallery"><?php |
|
| 20 | + <?php if ( ! empty($post->post_parent)) : ?> |
|
| 21 | + <p class="page-title"><a href="<?php echo esc_url(get_permalink($post->post_parent)); ?>" title="<?php echo esc_attr(sprintf(__('Return to %s', 'twentyten'), strip_tags(get_the_title($post->post_parent)))); ?>" rel="gallery"><?php |
|
| 22 | 22 | /* translators: %s - title of parent post */ |
| 23 | - printf( __( '<span class="meta-nav">←</span> %s', 'twentyten' ), get_the_title( $post->post_parent ) ); |
|
| 23 | + printf(__('<span class="meta-nav">←</span> %s', 'twentyten'), get_the_title($post->post_parent)); |
|
| 24 | 24 | ?></a></p> |
| 25 | 25 | <?php endif; ?> |
| 26 | 26 | |
@@ -29,64 +29,64 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | <div class="entry-meta"> |
| 31 | 31 | <?php |
| 32 | - printf( __( '<span class="%1$s">By</span> %2$s', 'twentyten' ), |
|
| 32 | + printf(__('<span class="%1$s">By</span> %2$s', 'twentyten'), |
|
| 33 | 33 | 'meta-prep meta-prep-author', |
| 34 | - sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', |
|
| 35 | - get_author_posts_url( get_the_author_meta( 'ID' ) ), |
|
| 36 | - esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ), |
|
| 34 | + sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', |
|
| 35 | + get_author_posts_url(get_the_author_meta('ID')), |
|
| 36 | + esc_attr(sprintf(__('View all posts by %s', 'twentyten'), get_the_author())), |
|
| 37 | 37 | get_the_author() |
| 38 | 38 | ) |
| 39 | 39 | ); |
| 40 | 40 | ?> |
| 41 | 41 | <span class="meta-sep">|</span> |
| 42 | 42 | <?php |
| 43 | - printf( __( '<span class="%1$s">Published</span> %2$s', 'twentyten' ), |
|
| 43 | + printf(__('<span class="%1$s">Published</span> %2$s', 'twentyten'), |
|
| 44 | 44 | 'meta-prep meta-prep-entry-date', |
| 45 | - sprintf( '<span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span>', |
|
| 46 | - esc_attr( get_the_time() ), |
|
| 45 | + sprintf('<span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span>', |
|
| 46 | + esc_attr(get_the_time()), |
|
| 47 | 47 | get_the_date() |
| 48 | 48 | ) |
| 49 | 49 | ); |
| 50 | - if ( wp_attachment_is_image() ) { |
|
| 50 | + if (wp_attachment_is_image()) { |
|
| 51 | 51 | echo ' <span class="meta-sep">|</span> '; |
| 52 | 52 | $metadata = wp_get_attachment_metadata(); |
| 53 | - printf( __( 'Full size is %s pixels', 'twentyten' ), |
|
| 54 | - sprintf( '<a href="%1$s" title="%2$s">%3$s × %4$s</a>', |
|
| 55 | - esc_url( wp_get_attachment_url() ), |
|
| 56 | - esc_attr( __( 'Link to full-size image', 'twentyten' ) ), |
|
| 53 | + printf(__('Full size is %s pixels', 'twentyten'), |
|
| 54 | + sprintf('<a href="%1$s" title="%2$s">%3$s × %4$s</a>', |
|
| 55 | + esc_url(wp_get_attachment_url()), |
|
| 56 | + esc_attr(__('Link to full-size image', 'twentyten')), |
|
| 57 | 57 | $metadata['width'], |
| 58 | 58 | $metadata['height'] |
| 59 | 59 | ) |
| 60 | 60 | ); |
| 61 | 61 | } |
| 62 | 62 | ?> |
| 63 | - <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?> |
|
| 63 | + <?php edit_post_link(__('Edit', 'twentyten'), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>'); ?> |
|
| 64 | 64 | </div><!-- .entry-meta --> |
| 65 | 65 | |
| 66 | 66 | <div class="entry-content"> |
| 67 | 67 | <div class="entry-attachment"> |
| 68 | -<?php if ( wp_attachment_is_image() ) : |
|
| 69 | - $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' ) ) ); |
|
| 70 | - foreach ( $attachments as $k => $attachment ) { |
|
| 71 | - if ( $attachment->ID == $post->ID ) |
|
| 68 | +<?php if (wp_attachment_is_image()) : |
|
| 69 | + $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'))); |
|
| 70 | + foreach ($attachments as $k => $attachment) { |
|
| 71 | + if ($attachment->ID == $post->ID) |
|
| 72 | 72 | break; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | // If there is more than 1 image attachment in a gallery |
| 76 | - if ( count( $attachments ) > 1 ) { |
|
| 76 | + if (count($attachments) > 1) { |
|
| 77 | 77 | $k++; |
| 78 | - if ( isset( $attachments[ $k ] ) ) |
|
| 78 | + if (isset($attachments[$k])) |
|
| 79 | 79 | // get the URL of the next image attachment |
| 80 | - $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); |
|
| 80 | + $next_attachment_url = get_attachment_link($attachments[$k]->ID); |
|
| 81 | 81 | else |
| 82 | 82 | // or get the URL of the first image attachment |
| 83 | - $next_attachment_url = get_attachment_link( $attachments[0]->ID ); |
|
| 83 | + $next_attachment_url = get_attachment_link($attachments[0]->ID); |
|
| 84 | 84 | } else { |
| 85 | 85 | // or, if there's only 1 image attachment, get the URL of the image |
| 86 | 86 | $next_attachment_url = wp_get_attachment_url(); |
| 87 | 87 | } |
| 88 | 88 | ?> |
| 89 | - <p class="attachment"><a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php |
|
| 89 | + <p class="attachment"><a href="<?php echo esc_url($next_attachment_url); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php |
|
| 90 | 90 | /** |
| 91 | 91 | * Filter the Twenty Ten default attachment width. |
| 92 | 92 | * |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * |
| 95 | 95 | * @param int The default attachment width in pixels. Default 900. |
| 96 | 96 | */ |
| 97 | - $attachment_width = apply_filters( 'twentyten_attachment_size', 900 ); |
|
| 97 | + $attachment_width = apply_filters('twentyten_attachment_size', 900); |
|
| 98 | 98 | /** |
| 99 | 99 | * Filter the Twenty Ten default attachment height. |
| 100 | 100 | * |
@@ -102,28 +102,28 @@ discard block |
||
| 102 | 102 | * |
| 103 | 103 | * @param int The default attachment height in pixels. Default 900. |
| 104 | 104 | */ |
| 105 | - $attachment_height = apply_filters( 'twentyten_attachment_height', 900 ); |
|
| 106 | - echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) ); // filterable image width with, essentially, no limit for image height. |
|
| 105 | + $attachment_height = apply_filters('twentyten_attachment_height', 900); |
|
| 106 | + echo wp_get_attachment_image($post->ID, array($attachment_width, $attachment_height)); // filterable image width with, essentially, no limit for image height. |
|
| 107 | 107 | ?></a></p> |
| 108 | 108 | |
| 109 | 109 | <div id="nav-below" class="navigation"> |
| 110 | - <div class="nav-previous"><?php previous_image_link( false ); ?></div> |
|
| 111 | - <div class="nav-next"><?php next_image_link( false ); ?></div> |
|
| 110 | + <div class="nav-previous"><?php previous_image_link(false); ?></div> |
|
| 111 | + <div class="nav-next"><?php next_image_link(false); ?></div> |
|
| 112 | 112 | </div><!-- #nav-below --> |
| 113 | 113 | <?php else : ?> |
| 114 | - <a href="<?php echo esc_url( wp_get_attachment_url() ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php echo esc_html( basename( get_permalink() ) ); ?></a> |
|
| 114 | + <a href="<?php echo esc_url(wp_get_attachment_url()); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php echo esc_html(basename(get_permalink())); ?></a> |
|
| 115 | 115 | <?php endif; ?> |
| 116 | 116 | </div><!-- .entry-attachment --> |
| 117 | - <div class="entry-caption"><?php if ( ! empty( $post->post_excerpt ) ) the_excerpt(); ?></div> |
|
| 117 | + <div class="entry-caption"><?php if ( ! empty($post->post_excerpt)) the_excerpt(); ?></div> |
|
| 118 | 118 | |
| 119 | -<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?> |
|
| 120 | -<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> |
|
| 119 | +<?php the_content(__('Continue reading <span class="meta-nav">→</span>', 'twentyten')); ?> |
|
| 120 | +<?php wp_link_pages(array('before' => '<div class="page-link">'.__('Pages:', 'twentyten'), 'after' => '</div>')); ?> |
|
| 121 | 121 | |
| 122 | 122 | </div><!-- .entry-content --> |
| 123 | 123 | |
| 124 | 124 | <div class="entry-utility"> |
| 125 | 125 | <?php twentyten_posted_in(); ?> |
| 126 | - <?php edit_post_link( __( 'Edit', 'twentyten' ), ' <span class="edit-link">', '</span>' ); ?> |
|
| 126 | + <?php edit_post_link(__('Edit', 'twentyten'), ' <span class="edit-link">', '</span>'); ?> |
|
| 127 | 127 | </div><!-- .entry-utility --> |
| 128 | 128 | </div><!-- #post-## --> |
| 129 | 129 | |
@@ -15,7 +15,10 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | ?> |
| 17 | 17 | |
| 18 | -<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> |
|
| 18 | +<?php if ( have_posts() ) { |
|
| 19 | + while ( have_posts() ) : the_post(); |
|
| 20 | +} |
|
| 21 | +?> |
|
| 19 | 22 | |
| 20 | 23 | <?php if ( ! empty( $post->post_parent ) ) : ?> |
| 21 | 24 | <p class="page-title"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'Return to %s', 'twentyten' ), strip_tags( get_the_title( $post->post_parent ) ) ) ); ?>" rel="gallery"><?php |
@@ -68,19 +71,21 @@ discard block |
||
| 68 | 71 | <?php if ( wp_attachment_is_image() ) : |
| 69 | 72 | $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' ) ) ); |
| 70 | 73 | foreach ( $attachments as $k => $attachment ) { |
| 71 | - if ( $attachment->ID == $post->ID ) |
|
| 72 | - break; |
|
| 74 | + if ( $attachment->ID == $post->ID ) { |
|
| 75 | + break; |
|
| 76 | + } |
|
| 73 | 77 | } |
| 74 | 78 | |
| 75 | 79 | // If there is more than 1 image attachment in a gallery |
| 76 | 80 | if ( count( $attachments ) > 1 ) { |
| 77 | 81 | $k++; |
| 78 | - if ( isset( $attachments[ $k ] ) ) |
|
| 79 | - // get the URL of the next image attachment |
|
| 82 | + if ( isset( $attachments[ $k ] ) ) { |
|
| 83 | + // get the URL of the next image attachment |
|
| 80 | 84 | $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); |
| 81 | - else |
|
| 82 | - // or get the URL of the first image attachment |
|
| 85 | + } else { |
|
| 86 | + // or get the URL of the first image attachment |
|
| 83 | 87 | $next_attachment_url = get_attachment_link( $attachments[0]->ID ); |
| 88 | + } |
|
| 84 | 89 | } else { |
| 85 | 90 | // or, if there's only 1 image attachment, get the URL of the image |
| 86 | 91 | $next_attachment_url = wp_get_attachment_url(); |
@@ -110,11 +115,17 @@ discard block |
||
| 110 | 115 | <div class="nav-previous"><?php previous_image_link( false ); ?></div> |
| 111 | 116 | <div class="nav-next"><?php next_image_link( false ); ?></div> |
| 112 | 117 | </div><!-- #nav-below --> |
| 113 | -<?php else : ?> |
|
| 114 | - <a href="<?php echo esc_url( wp_get_attachment_url() ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php echo esc_html( basename( get_permalink() ) ); ?></a> |
|
| 118 | +<?php else { |
|
| 119 | + : ?> |
|
| 120 | + <a href="<?php echo esc_url( wp_get_attachment_url() ); |
|
| 121 | +} |
|
| 122 | +?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php echo esc_html( basename( get_permalink() ) ); ?></a> |
|
| 115 | 123 | <?php endif; ?> |
| 116 | 124 | </div><!-- .entry-attachment --> |
| 117 | - <div class="entry-caption"><?php if ( ! empty( $post->post_excerpt ) ) the_excerpt(); ?></div> |
|
| 125 | + <div class="entry-caption"><?php if ( ! empty( $post->post_excerpt ) ) { |
|
| 126 | + the_excerpt(); |
|
| 127 | +} |
|
| 128 | +?></div> |
|
| 118 | 129 | |
| 119 | 130 | <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?> |
| 120 | 131 | <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> |
@@ -18,21 +18,21 @@ discard block |
||
| 18 | 18 | * then the sidebar simply doesn't exist, so we'll hard-code in |
| 19 | 19 | * some default sidebar stuff just in case. |
| 20 | 20 | */ |
| 21 | - if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?> |
|
| 21 | + if ( ! dynamic_sidebar('primary-widget-area')) : ?> |
|
| 22 | 22 | |
| 23 | 23 | <li id="search" class="widget-container widget_search"> |
| 24 | 24 | <?php get_search_form(); ?> |
| 25 | 25 | </li> |
| 26 | 26 | |
| 27 | 27 | <li id="archives" class="widget-container"> |
| 28 | - <h3 class="widget-title"><?php _e( 'Archives', 'twentyten' ); ?></h3> |
|
| 28 | + <h3 class="widget-title"><?php _e('Archives', 'twentyten'); ?></h3> |
|
| 29 | 29 | <ul> |
| 30 | - <?php wp_get_archives( 'type=monthly' ); ?> |
|
| 30 | + <?php wp_get_archives('type=monthly'); ?> |
|
| 31 | 31 | </ul> |
| 32 | 32 | </li> |
| 33 | 33 | |
| 34 | 34 | <li id="meta" class="widget-container"> |
| 35 | - <h3 class="widget-title"><?php _e( 'Meta', 'twentyten' ); ?></h3> |
|
| 35 | + <h3 class="widget-title"><?php _e('Meta', 'twentyten'); ?></h3> |
|
| 36 | 36 | <ul> |
| 37 | 37 | <?php wp_register(); ?> |
| 38 | 38 | <li><?php wp_loginout(); ?></li> |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | <?php |
| 48 | 48 | // A second sidebar for widgets, just because. |
| 49 | - if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?> |
|
| 49 | + if (is_active_sidebar('secondary-widget-area')) : ?> |
|
| 50 | 50 | |
| 51 | 51 | <div id="secondary" class="widget-area" role="complementary"> |
| 52 | 52 | <ul class="xoxo"> |
| 53 | - <?php dynamic_sidebar( 'secondary-widget-area' ); ?> |
|
| 53 | + <?php dynamic_sidebar('secondary-widget-area'); ?> |
|
| 54 | 54 | </ul> |
| 55 | 55 | </div><!-- #secondary .widget-area --> |
| 56 | 56 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | * If you want to overload this in a child theme then include a file |
| 25 | 25 | * called loop-index.php and that will be used instead. |
| 26 | 26 | */ |
| 27 | - get_template_part( 'loop', 'index' ); |
|
| 27 | + get_template_part('loop', 'index'); |
|
| 28 | 28 | ?> |
| 29 | 29 | </div><!-- #content --> |
| 30 | 30 | </div><!-- #container --> |
@@ -44,13 +44,13 @@ discard block |
||
| 44 | 44 | * Used to set the width of images and content. Should be equal to the width the theme |
| 45 | 45 | * is designed for, generally via the style.css stylesheet. |
| 46 | 46 | */ |
| 47 | -if ( ! isset( $content_width ) ) |
|
| 47 | +if ( ! isset($content_width)) |
|
| 48 | 48 | $content_width = 640; |
| 49 | 49 | |
| 50 | 50 | /* Tell WordPress to run twentyten_setup() when the 'after_setup_theme' hook is run. */ |
| 51 | -add_action( 'after_setup_theme', 'twentyten_setup' ); |
|
| 51 | +add_action('after_setup_theme', 'twentyten_setup'); |
|
| 52 | 52 | |
| 53 | -if ( ! function_exists( 'twentyten_setup' ) ): |
|
| 53 | +if ( ! function_exists('twentyten_setup')): |
|
| 54 | 54 | /** |
| 55 | 55 | * Set up theme defaults and registers support for various WordPress features. |
| 56 | 56 | * |
@@ -76,30 +76,30 @@ discard block |
||
| 76 | 76 | add_editor_style(); |
| 77 | 77 | |
| 78 | 78 | // Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories. |
| 79 | - add_theme_support( 'post-formats', array( 'aside', 'gallery' ) ); |
|
| 79 | + add_theme_support('post-formats', array('aside', 'gallery')); |
|
| 80 | 80 | |
| 81 | 81 | // This theme uses post thumbnails |
| 82 | - add_theme_support( 'post-thumbnails' ); |
|
| 82 | + add_theme_support('post-thumbnails'); |
|
| 83 | 83 | |
| 84 | 84 | // Add default posts and comments RSS feed links to head |
| 85 | - add_theme_support( 'automatic-feed-links' ); |
|
| 85 | + add_theme_support('automatic-feed-links'); |
|
| 86 | 86 | |
| 87 | 87 | /* |
| 88 | 88 | * Make theme available for translation. |
| 89 | 89 | * Translations can be filed in the /languages/ directory |
| 90 | 90 | */ |
| 91 | - load_theme_textdomain( 'twentyten', get_template_directory() . '/languages' ); |
|
| 91 | + load_theme_textdomain('twentyten', get_template_directory().'/languages'); |
|
| 92 | 92 | |
| 93 | 93 | // This theme uses wp_nav_menu() in one location. |
| 94 | - register_nav_menus( array( |
|
| 95 | - 'primary' => __( 'Primary Navigation', 'twentyten' ), |
|
| 96 | - ) ); |
|
| 94 | + register_nav_menus(array( |
|
| 95 | + 'primary' => __('Primary Navigation', 'twentyten'), |
|
| 96 | + )); |
|
| 97 | 97 | |
| 98 | 98 | // This theme allows users to set a custom background. |
| 99 | - add_theme_support( 'custom-background', array( |
|
| 99 | + add_theme_support('custom-background', array( |
|
| 100 | 100 | // Let WordPress know what our default background color is. |
| 101 | 101 | 'default-color' => 'f1f1f1', |
| 102 | - ) ); |
|
| 102 | + )); |
|
| 103 | 103 | |
| 104 | 104 | // The custom header business starts here. |
| 105 | 105 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * |
| 118 | 118 | * @param int The default header image width in pixels. Default 940. |
| 119 | 119 | */ |
| 120 | - 'width' => apply_filters( 'twentyten_header_image_width', 940 ), |
|
| 120 | + 'width' => apply_filters('twentyten_header_image_width', 940), |
|
| 121 | 121 | /** |
| 122 | 122 | * Filter the Twenty Ten defaul header image height. |
| 123 | 123 | * |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * |
| 126 | 126 | * @param int The default header image height in pixels. Default 198. |
| 127 | 127 | */ |
| 128 | - 'height' => apply_filters( 'twentyten_header_image_height', 198 ), |
|
| 128 | + 'height' => apply_filters('twentyten_header_image_height', 198), |
|
| 129 | 129 | // Support flexible heights. |
| 130 | 130 | 'flex-height' => true, |
| 131 | 131 | // Don't support text inside the header image. |
@@ -134,16 +134,16 @@ discard block |
||
| 134 | 134 | 'admin-head-callback' => 'twentyten_admin_header_style', |
| 135 | 135 | ); |
| 136 | 136 | |
| 137 | - add_theme_support( 'custom-header', $custom_header_support ); |
|
| 137 | + add_theme_support('custom-header', $custom_header_support); |
|
| 138 | 138 | |
| 139 | - if ( ! function_exists( 'get_custom_header' ) ) { |
|
| 139 | + if ( ! function_exists('get_custom_header')) { |
|
| 140 | 140 | // This is all for compatibility with versions of WordPress prior to 3.4. |
| 141 | - define( 'HEADER_TEXTCOLOR', '' ); |
|
| 142 | - define( 'NO_HEADER_TEXT', true ); |
|
| 143 | - define( 'HEADER_IMAGE', $custom_header_support['default-image'] ); |
|
| 144 | - define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] ); |
|
| 145 | - define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] ); |
|
| 146 | - add_custom_image_header( '', $custom_header_support['admin-head-callback'] ); |
|
| 141 | + define('HEADER_TEXTCOLOR', ''); |
|
| 142 | + define('NO_HEADER_TEXT', true); |
|
| 143 | + define('HEADER_IMAGE', $custom_header_support['default-image']); |
|
| 144 | + define('HEADER_IMAGE_WIDTH', $custom_header_support['width']); |
|
| 145 | + define('HEADER_IMAGE_HEIGHT', $custom_header_support['height']); |
|
| 146 | + add_custom_image_header('', $custom_header_support['admin-head-callback']); |
|
| 147 | 147 | add_custom_background(); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -152,65 +152,65 @@ discard block |
||
| 152 | 152 | * We want them to be 940 pixels wide by 198 pixels tall. |
| 153 | 153 | * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. |
| 154 | 154 | */ |
| 155 | - set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true ); |
|
| 155 | + set_post_thumbnail_size($custom_header_support['width'], $custom_header_support['height'], true); |
|
| 156 | 156 | |
| 157 | 157 | // ... and thus ends the custom header business. |
| 158 | 158 | |
| 159 | 159 | // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. |
| 160 | - register_default_headers( array( |
|
| 160 | + register_default_headers(array( |
|
| 161 | 161 | 'berries' => array( |
| 162 | 162 | 'url' => '%s/images/headers/berries.jpg', |
| 163 | 163 | 'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg', |
| 164 | 164 | /* translators: header image description */ |
| 165 | - 'description' => __( 'Berries', 'twentyten' ) |
|
| 165 | + 'description' => __('Berries', 'twentyten') |
|
| 166 | 166 | ), |
| 167 | 167 | 'cherryblossom' => array( |
| 168 | 168 | 'url' => '%s/images/headers/cherryblossoms.jpg', |
| 169 | 169 | 'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg', |
| 170 | 170 | /* translators: header image description */ |
| 171 | - 'description' => __( 'Cherry Blossoms', 'twentyten' ) |
|
| 171 | + 'description' => __('Cherry Blossoms', 'twentyten') |
|
| 172 | 172 | ), |
| 173 | 173 | 'concave' => array( |
| 174 | 174 | 'url' => '%s/images/headers/concave.jpg', |
| 175 | 175 | 'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg', |
| 176 | 176 | /* translators: header image description */ |
| 177 | - 'description' => __( 'Concave', 'twentyten' ) |
|
| 177 | + 'description' => __('Concave', 'twentyten') |
|
| 178 | 178 | ), |
| 179 | 179 | 'fern' => array( |
| 180 | 180 | 'url' => '%s/images/headers/fern.jpg', |
| 181 | 181 | 'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg', |
| 182 | 182 | /* translators: header image description */ |
| 183 | - 'description' => __( 'Fern', 'twentyten' ) |
|
| 183 | + 'description' => __('Fern', 'twentyten') |
|
| 184 | 184 | ), |
| 185 | 185 | 'forestfloor' => array( |
| 186 | 186 | 'url' => '%s/images/headers/forestfloor.jpg', |
| 187 | 187 | 'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg', |
| 188 | 188 | /* translators: header image description */ |
| 189 | - 'description' => __( 'Forest Floor', 'twentyten' ) |
|
| 189 | + 'description' => __('Forest Floor', 'twentyten') |
|
| 190 | 190 | ), |
| 191 | 191 | 'inkwell' => array( |
| 192 | 192 | 'url' => '%s/images/headers/inkwell.jpg', |
| 193 | 193 | 'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg', |
| 194 | 194 | /* translators: header image description */ |
| 195 | - 'description' => __( 'Inkwell', 'twentyten' ) |
|
| 195 | + 'description' => __('Inkwell', 'twentyten') |
|
| 196 | 196 | ), |
| 197 | 197 | 'path' => array( |
| 198 | 198 | 'url' => '%s/images/headers/path.jpg', |
| 199 | 199 | 'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg', |
| 200 | 200 | /* translators: header image description */ |
| 201 | - 'description' => __( 'Path', 'twentyten' ) |
|
| 201 | + 'description' => __('Path', 'twentyten') |
|
| 202 | 202 | ), |
| 203 | 203 | 'sunset' => array( |
| 204 | 204 | 'url' => '%s/images/headers/sunset.jpg', |
| 205 | 205 | 'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg', |
| 206 | 206 | /* translators: header image description */ |
| 207 | - 'description' => __( 'Sunset', 'twentyten' ) |
|
| 207 | + 'description' => __('Sunset', 'twentyten') |
|
| 208 | 208 | ) |
| 209 | - ) ); |
|
| 209 | + )); |
|
| 210 | 210 | } |
| 211 | 211 | endif; |
| 212 | 212 | |
| 213 | -if ( ! function_exists( 'twentyten_admin_header_style' ) ) : |
|
| 213 | +if ( ! function_exists('twentyten_admin_header_style')) : |
|
| 214 | 214 | /** |
| 215 | 215 | * Style the header image displayed on the Appearance > Header admin panel. |
| 216 | 216 | * |
@@ -245,12 +245,12 @@ discard block |
||
| 245 | 245 | * |
| 246 | 246 | * @param array $args An optional array of arguments. @see wp_page_menu() |
| 247 | 247 | */ |
| 248 | -function twentyten_page_menu_args( $args ) { |
|
| 249 | - if ( ! isset( $args['show_home'] ) ) |
|
| 248 | +function twentyten_page_menu_args($args) { |
|
| 249 | + if ( ! isset($args['show_home'])) |
|
| 250 | 250 | $args['show_home'] = true; |
| 251 | 251 | return $args; |
| 252 | 252 | } |
| 253 | -add_filter( 'wp_page_menu_args', 'twentyten_page_menu_args' ); |
|
| 253 | +add_filter('wp_page_menu_args', 'twentyten_page_menu_args'); |
|
| 254 | 254 | |
| 255 | 255 | /** |
| 256 | 256 | * Set the post excerpt length to 40 characters. |
@@ -263,12 +263,12 @@ discard block |
||
| 263 | 263 | * @param int $length The number of excerpt characters. |
| 264 | 264 | * @return int The filtered number of excerpt characters. |
| 265 | 265 | */ |
| 266 | -function twentyten_excerpt_length( $length ) { |
|
| 266 | +function twentyten_excerpt_length($length) { |
|
| 267 | 267 | return 40; |
| 268 | 268 | } |
| 269 | -add_filter( 'excerpt_length', 'twentyten_excerpt_length' ); |
|
| 269 | +add_filter('excerpt_length', 'twentyten_excerpt_length'); |
|
| 270 | 270 | |
| 271 | -if ( ! function_exists( 'twentyten_continue_reading_link' ) ) : |
|
| 271 | +if ( ! function_exists('twentyten_continue_reading_link')) : |
|
| 272 | 272 | /** |
| 273 | 273 | * Return a "Continue Reading" link for excerpts. |
| 274 | 274 | * |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | * @return string "Continue Reading" link. |
| 278 | 278 | */ |
| 279 | 279 | function twentyten_continue_reading_link() { |
| 280 | - return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) . '</a>'; |
|
| 280 | + return ' <a href="'.get_permalink().'">'.__('Continue reading <span class="meta-nav">→</span>', 'twentyten').'</a>'; |
|
| 281 | 281 | } |
| 282 | 282 | endif; |
| 283 | 283 | |
@@ -294,13 +294,13 @@ discard block |
||
| 294 | 294 | * @param string $more The Read More text. |
| 295 | 295 | * @return string An ellipsis. |
| 296 | 296 | */ |
| 297 | -function twentyten_auto_excerpt_more( $more ) { |
|
| 298 | - if ( ! is_admin() ) { |
|
| 299 | - return ' …' . twentyten_continue_reading_link(); |
|
| 297 | +function twentyten_auto_excerpt_more($more) { |
|
| 298 | + if ( ! is_admin()) { |
|
| 299 | + return ' …'.twentyten_continue_reading_link(); |
|
| 300 | 300 | } |
| 301 | 301 | return $more; |
| 302 | 302 | } |
| 303 | -add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' ); |
|
| 303 | +add_filter('excerpt_more', 'twentyten_auto_excerpt_more'); |
|
| 304 | 304 | |
| 305 | 305 | /** |
| 306 | 306 | * Add a pretty "Continue Reading" link to custom post excerpts. |
@@ -313,13 +313,13 @@ discard block |
||
| 313 | 313 | * @param string $output The "Coninue Reading" link. |
| 314 | 314 | * @return string Excerpt with a pretty "Continue Reading" link. |
| 315 | 315 | */ |
| 316 | -function twentyten_custom_excerpt_more( $output ) { |
|
| 317 | - if ( has_excerpt() && ! is_attachment() && ! is_admin() ) { |
|
| 316 | +function twentyten_custom_excerpt_more($output) { |
|
| 317 | + if (has_excerpt() && ! is_attachment() && ! is_admin()) { |
|
| 318 | 318 | $output .= twentyten_continue_reading_link(); |
| 319 | 319 | } |
| 320 | 320 | return $output; |
| 321 | 321 | } |
| 322 | -add_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' ); |
|
| 322 | +add_filter('get_the_excerpt', 'twentyten_custom_excerpt_more'); |
|
| 323 | 323 | |
| 324 | 324 | /** |
| 325 | 325 | * Remove inline styles printed when the gallery shortcode is used. |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | * |
| 330 | 330 | * @since Twenty Ten 1.2 |
| 331 | 331 | */ |
| 332 | -add_filter( 'use_default_gallery_style', '__return_false' ); |
|
| 332 | +add_filter('use_default_gallery_style', '__return_false'); |
|
| 333 | 333 | |
| 334 | 334 | /** |
| 335 | 335 | * Deprecated way to remove inline styles printed when the gallery shortcode is used. |
@@ -342,14 +342,14 @@ discard block |
||
| 342 | 342 | * |
| 343 | 343 | * @return string The gallery style filter, with the styles themselves removed. |
| 344 | 344 | */ |
| 345 | -function twentyten_remove_gallery_css( $css ) { |
|
| 346 | - return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css ); |
|
| 345 | +function twentyten_remove_gallery_css($css) { |
|
| 346 | + return preg_replace("#<style type='text/css'>(.*?)</style>#s", '', $css); |
|
| 347 | 347 | } |
| 348 | 348 | // Backwards compatibility with WordPress 3.0. |
| 349 | -if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) |
|
| 350 | - add_filter( 'gallery_style', 'twentyten_remove_gallery_css' ); |
|
| 349 | +if (version_compare($GLOBALS['wp_version'], '3.1', '<')) |
|
| 350 | + add_filter('gallery_style', 'twentyten_remove_gallery_css'); |
|
| 351 | 351 | |
| 352 | -if ( ! function_exists( 'twentyten_comment' ) ) : |
|
| 352 | +if ( ! function_exists('twentyten_comment')) : |
|
| 353 | 353 | /** |
| 354 | 354 | * Template for comments and pingbacks. |
| 355 | 355 | * |
@@ -364,33 +364,33 @@ discard block |
||
| 364 | 364 | * @param array $args An array of arguments. @see get_comment_reply_link() |
| 365 | 365 | * @param int $depth The depth of the comment. |
| 366 | 366 | */ |
| 367 | -function twentyten_comment( $comment, $args, $depth ) { |
|
| 367 | +function twentyten_comment($comment, $args, $depth) { |
|
| 368 | 368 | $GLOBALS['comment'] = $comment; |
| 369 | - switch ( $comment->comment_type ) : |
|
| 369 | + switch ($comment->comment_type) : |
|
| 370 | 370 | case '' : |
| 371 | 371 | ?> |
| 372 | 372 | <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> |
| 373 | 373 | <div id="comment-<?php comment_ID(); ?>"> |
| 374 | 374 | <div class="comment-author vcard"> |
| 375 | - <?php echo get_avatar( $comment, 40 ); ?> |
|
| 376 | - <?php printf( __( '%s <span class="says">says:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?> |
|
| 375 | + <?php echo get_avatar($comment, 40); ?> |
|
| 376 | + <?php printf(__('%s <span class="says">says:</span>', 'twentyten'), sprintf('<cite class="fn">%s</cite>', get_comment_author_link())); ?> |
|
| 377 | 377 | </div><!-- .comment-author .vcard --> |
| 378 | - <?php if ( $comment->comment_approved == '0' ) : ?> |
|
| 379 | - <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em> |
|
| 378 | + <?php if ($comment->comment_approved == '0') : ?> |
|
| 379 | + <em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.', 'twentyten'); ?></em> |
|
| 380 | 380 | <br /> |
| 381 | 381 | <?php endif; ?> |
| 382 | 382 | |
| 383 | - <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"> |
|
| 383 | + <div class="comment-meta commentmetadata"><a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>"> |
|
| 384 | 384 | <?php |
| 385 | 385 | /* translators: 1: date, 2: time */ |
| 386 | - printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); |
|
| 386 | + printf(__('%1$s at %2$s', 'twentyten'), get_comment_date(), get_comment_time()); ?></a><?php edit_comment_link(__('(Edit)', 'twentyten'), ' '); |
|
| 387 | 387 | ?> |
| 388 | 388 | </div><!-- .comment-meta .commentmetadata --> |
| 389 | 389 | |
| 390 | 390 | <div class="comment-body"><?php comment_text(); ?></div> |
| 391 | 391 | |
| 392 | 392 | <div class="reply"> |
| 393 | - <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> |
|
| 393 | + <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?> |
|
| 394 | 394 | </div><!-- .reply --> |
| 395 | 395 | </div><!-- #comment-## --> |
| 396 | 396 | |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | case 'trackback' : |
| 401 | 401 | ?> |
| 402 | 402 | <li class="post pingback"> |
| 403 | - <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p> |
|
| 403 | + <p><?php _e('Pingback:', 'twentyten'); ?> <?php comment_author_link(); ?><?php edit_comment_link(__('(Edit)', 'twentyten'), ' '); ?></p> |
|
| 404 | 404 | <?php |
| 405 | 405 | break; |
| 406 | 406 | endswitch; |
@@ -419,73 +419,73 @@ discard block |
||
| 419 | 419 | */ |
| 420 | 420 | function twentyten_widgets_init() { |
| 421 | 421 | // Area 1, located at the top of the sidebar. |
| 422 | - register_sidebar( array( |
|
| 423 | - 'name' => __( 'Primary Widget Area', 'twentyten' ), |
|
| 422 | + register_sidebar(array( |
|
| 423 | + 'name' => __('Primary Widget Area', 'twentyten'), |
|
| 424 | 424 | 'id' => 'primary-widget-area', |
| 425 | - 'description' => __( 'Add widgets here to appear in your sidebar.', 'twentyten' ), |
|
| 425 | + 'description' => __('Add widgets here to appear in your sidebar.', 'twentyten'), |
|
| 426 | 426 | 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', |
| 427 | 427 | 'after_widget' => '</li>', |
| 428 | 428 | 'before_title' => '<h3 class="widget-title">', |
| 429 | 429 | 'after_title' => '</h3>', |
| 430 | - ) ); |
|
| 430 | + )); |
|
| 431 | 431 | |
| 432 | 432 | // Area 2, located below the Primary Widget Area in the sidebar. Empty by default. |
| 433 | - register_sidebar( array( |
|
| 434 | - 'name' => __( 'Secondary Widget Area', 'twentyten' ), |
|
| 433 | + register_sidebar(array( |
|
| 434 | + 'name' => __('Secondary Widget Area', 'twentyten'), |
|
| 435 | 435 | 'id' => 'secondary-widget-area', |
| 436 | - 'description' => __( 'An optional secondary widget area, displays below the primary widget area in your sidebar.', 'twentyten' ), |
|
| 436 | + 'description' => __('An optional secondary widget area, displays below the primary widget area in your sidebar.', 'twentyten'), |
|
| 437 | 437 | 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', |
| 438 | 438 | 'after_widget' => '</li>', |
| 439 | 439 | 'before_title' => '<h3 class="widget-title">', |
| 440 | 440 | 'after_title' => '</h3>', |
| 441 | - ) ); |
|
| 441 | + )); |
|
| 442 | 442 | |
| 443 | 443 | // Area 3, located in the footer. Empty by default. |
| 444 | - register_sidebar( array( |
|
| 445 | - 'name' => __( 'First Footer Widget Area', 'twentyten' ), |
|
| 444 | + register_sidebar(array( |
|
| 445 | + 'name' => __('First Footer Widget Area', 'twentyten'), |
|
| 446 | 446 | 'id' => 'first-footer-widget-area', |
| 447 | - 'description' => __( 'An optional widget area for your site footer.', 'twentyten' ), |
|
| 447 | + 'description' => __('An optional widget area for your site footer.', 'twentyten'), |
|
| 448 | 448 | 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', |
| 449 | 449 | 'after_widget' => '</li>', |
| 450 | 450 | 'before_title' => '<h3 class="widget-title">', |
| 451 | 451 | 'after_title' => '</h3>', |
| 452 | - ) ); |
|
| 452 | + )); |
|
| 453 | 453 | |
| 454 | 454 | // Area 4, located in the footer. Empty by default. |
| 455 | - register_sidebar( array( |
|
| 456 | - 'name' => __( 'Second Footer Widget Area', 'twentyten' ), |
|
| 455 | + register_sidebar(array( |
|
| 456 | + 'name' => __('Second Footer Widget Area', 'twentyten'), |
|
| 457 | 457 | 'id' => 'second-footer-widget-area', |
| 458 | - 'description' => __( 'An optional widget area for your site footer.', 'twentyten' ), |
|
| 458 | + 'description' => __('An optional widget area for your site footer.', 'twentyten'), |
|
| 459 | 459 | 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', |
| 460 | 460 | 'after_widget' => '</li>', |
| 461 | 461 | 'before_title' => '<h3 class="widget-title">', |
| 462 | 462 | 'after_title' => '</h3>', |
| 463 | - ) ); |
|
| 463 | + )); |
|
| 464 | 464 | |
| 465 | 465 | // Area 5, located in the footer. Empty by default. |
| 466 | - register_sidebar( array( |
|
| 467 | - 'name' => __( 'Third Footer Widget Area', 'twentyten' ), |
|
| 466 | + register_sidebar(array( |
|
| 467 | + 'name' => __('Third Footer Widget Area', 'twentyten'), |
|
| 468 | 468 | 'id' => 'third-footer-widget-area', |
| 469 | - 'description' => __( 'An optional widget area for your site footer.', 'twentyten' ), |
|
| 469 | + 'description' => __('An optional widget area for your site footer.', 'twentyten'), |
|
| 470 | 470 | 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', |
| 471 | 471 | 'after_widget' => '</li>', |
| 472 | 472 | 'before_title' => '<h3 class="widget-title">', |
| 473 | 473 | 'after_title' => '</h3>', |
| 474 | - ) ); |
|
| 474 | + )); |
|
| 475 | 475 | |
| 476 | 476 | // Area 6, located in the footer. Empty by default. |
| 477 | - register_sidebar( array( |
|
| 478 | - 'name' => __( 'Fourth Footer Widget Area', 'twentyten' ), |
|
| 477 | + register_sidebar(array( |
|
| 478 | + 'name' => __('Fourth Footer Widget Area', 'twentyten'), |
|
| 479 | 479 | 'id' => 'fourth-footer-widget-area', |
| 480 | - 'description' => __( 'An optional widget area for your site footer.', 'twentyten' ), |
|
| 480 | + 'description' => __('An optional widget area for your site footer.', 'twentyten'), |
|
| 481 | 481 | 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', |
| 482 | 482 | 'after_widget' => '</li>', |
| 483 | 483 | 'before_title' => '<h3 class="widget-title">', |
| 484 | 484 | 'after_title' => '</h3>', |
| 485 | - ) ); |
|
| 485 | + )); |
|
| 486 | 486 | } |
| 487 | 487 | /** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */ |
| 488 | -add_action( 'widgets_init', 'twentyten_widgets_init' ); |
|
| 488 | +add_action('widgets_init', 'twentyten_widgets_init'); |
|
| 489 | 489 | |
| 490 | 490 | /** |
| 491 | 491 | * Remove the default styles that are packaged with the Recent Comments widget. |
@@ -500,34 +500,34 @@ discard block |
||
| 500 | 500 | * @since Twenty Ten 1.0 |
| 501 | 501 | */ |
| 502 | 502 | function twentyten_remove_recent_comments_style() { |
| 503 | - add_filter( 'show_recent_comments_widget_style', '__return_false' ); |
|
| 503 | + add_filter('show_recent_comments_widget_style', '__return_false'); |
|
| 504 | 504 | } |
| 505 | -add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' ); |
|
| 505 | +add_action('widgets_init', 'twentyten_remove_recent_comments_style'); |
|
| 506 | 506 | |
| 507 | -if ( ! function_exists( 'twentyten_posted_on' ) ) : |
|
| 507 | +if ( ! function_exists('twentyten_posted_on')) : |
|
| 508 | 508 | /** |
| 509 | 509 | * Print HTML with meta information for the current post-date/time and author. |
| 510 | 510 | * |
| 511 | 511 | * @since Twenty Ten 1.0 |
| 512 | 512 | */ |
| 513 | 513 | function twentyten_posted_on() { |
| 514 | - printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ), |
|
| 514 | + printf(__('<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten'), |
|
| 515 | 515 | 'meta-prep meta-prep-author', |
| 516 | - sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>', |
|
| 516 | + sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>', |
|
| 517 | 517 | get_permalink(), |
| 518 | - esc_attr( get_the_time() ), |
|
| 518 | + esc_attr(get_the_time()), |
|
| 519 | 519 | get_the_date() |
| 520 | 520 | ), |
| 521 | - sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', |
|
| 522 | - get_author_posts_url( get_the_author_meta( 'ID' ) ), |
|
| 523 | - esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ), |
|
| 521 | + sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', |
|
| 522 | + get_author_posts_url(get_the_author_meta('ID')), |
|
| 523 | + esc_attr(sprintf(__('View all posts by %s', 'twentyten'), get_the_author())), |
|
| 524 | 524 | get_the_author() |
| 525 | 525 | ) |
| 526 | 526 | ); |
| 527 | 527 | } |
| 528 | 528 | endif; |
| 529 | 529 | |
| 530 | -if ( ! function_exists( 'twentyten_posted_in' ) ) : |
|
| 530 | +if ( ! function_exists('twentyten_posted_in')) : |
|
| 531 | 531 | /** |
| 532 | 532 | * Print HTML with meta information for the current post (category, tags and permalink). |
| 533 | 533 | * |
@@ -535,21 +535,21 @@ discard block |
||
| 535 | 535 | */ |
| 536 | 536 | function twentyten_posted_in() { |
| 537 | 537 | // Retrieves tag list of current post, separated by commas. |
| 538 | - $tag_list = get_the_tag_list( '', ', ' ); |
|
| 539 | - if ( $tag_list ) { |
|
| 540 | - $posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' ); |
|
| 541 | - } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { |
|
| 542 | - $posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' ); |
|
| 538 | + $tag_list = get_the_tag_list('', ', '); |
|
| 539 | + if ($tag_list) { |
|
| 540 | + $posted_in = __('This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten'); |
|
| 541 | + } elseif (is_object_in_taxonomy(get_post_type(), 'category')) { |
|
| 542 | + $posted_in = __('This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten'); |
|
| 543 | 543 | } else { |
| 544 | - $posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' ); |
|
| 544 | + $posted_in = __('Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten'); |
|
| 545 | 545 | } |
| 546 | 546 | // Prints the string, replacing the placeholders. |
| 547 | 547 | printf( |
| 548 | 548 | $posted_in, |
| 549 | - get_the_category_list( ', ' ), |
|
| 549 | + get_the_category_list(', '), |
|
| 550 | 550 | $tag_list, |
| 551 | 551 | get_permalink(), |
| 552 | - the_title_attribute( 'echo=0' ) |
|
| 552 | + the_title_attribute('echo=0') |
|
| 553 | 553 | ); |
| 554 | 554 | } |
| 555 | 555 | endif; |
@@ -567,20 +567,20 @@ discard block |
||
| 567 | 567 | function twentyten_get_gallery_images() { |
| 568 | 568 | $images = array(); |
| 569 | 569 | |
| 570 | - if ( function_exists( 'get_post_galleries' ) ) { |
|
| 571 | - $galleries = get_post_galleries( get_the_ID(), false ); |
|
| 572 | - if ( isset( $galleries[0]['ids'] ) ) |
|
| 573 | - $images = explode( ',', $galleries[0]['ids'] ); |
|
| 570 | + if (function_exists('get_post_galleries')) { |
|
| 571 | + $galleries = get_post_galleries(get_the_ID(), false); |
|
| 572 | + if (isset($galleries[0]['ids'])) |
|
| 573 | + $images = explode(',', $galleries[0]['ids']); |
|
| 574 | 574 | } else { |
| 575 | 575 | $pattern = get_shortcode_regex(); |
| 576 | - preg_match( "/$pattern/s", get_the_content(), $match ); |
|
| 577 | - $atts = shortcode_parse_atts( $match[3] ); |
|
| 578 | - if ( isset( $atts['ids'] ) ) |
|
| 579 | - $images = explode( ',', $atts['ids'] ); |
|
| 576 | + preg_match("/$pattern/s", get_the_content(), $match); |
|
| 577 | + $atts = shortcode_parse_atts($match[3]); |
|
| 578 | + if (isset($atts['ids'])) |
|
| 579 | + $images = explode(',', $atts['ids']); |
|
| 580 | 580 | } |
| 581 | 581 | |
| 582 | - if ( ! $images ) { |
|
| 583 | - $images = get_posts( array( |
|
| 582 | + if ( ! $images) { |
|
| 583 | + $images = get_posts(array( |
|
| 584 | 584 | 'fields' => 'ids', |
| 585 | 585 | 'numberposts' => 999, |
| 586 | 586 | 'order' => 'ASC', |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | 'post_mime_type' => 'image', |
| 589 | 589 | 'post_parent' => get_the_ID(), |
| 590 | 590 | 'post_type' => 'attachment', |
| 591 | - ) ); |
|
| 591 | + )); |
|
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | return $images; |
@@ -44,8 +44,9 @@ discard block |
||
| 44 | 44 | * Used to set the width of images and content. Should be equal to the width the theme |
| 45 | 45 | * is designed for, generally via the style.css stylesheet. |
| 46 | 46 | */ |
| 47 | -if ( ! isset( $content_width ) ) |
|
| 47 | +if ( ! isset( $content_width ) ) { |
|
| 48 | 48 | $content_width = 640; |
| 49 | +} |
|
| 49 | 50 | |
| 50 | 51 | /* Tell WordPress to run twentyten_setup() when the 'after_setup_theme' hook is run. */ |
| 51 | 52 | add_action( 'after_setup_theme', 'twentyten_setup' ); |
@@ -246,8 +247,9 @@ discard block |
||
| 246 | 247 | * @param array $args An optional array of arguments. @see wp_page_menu() |
| 247 | 248 | */ |
| 248 | 249 | function twentyten_page_menu_args( $args ) { |
| 249 | - if ( ! isset( $args['show_home'] ) ) |
|
| 250 | - $args['show_home'] = true; |
|
| 250 | + if ( ! isset( $args['show_home'] ) ) { |
|
| 251 | + $args['show_home'] = true; |
|
| 252 | + } |
|
| 251 | 253 | return $args; |
| 252 | 254 | } |
| 253 | 255 | add_filter( 'wp_page_menu_args', 'twentyten_page_menu_args' ); |
@@ -346,8 +348,9 @@ discard block |
||
| 346 | 348 | return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css ); |
| 347 | 349 | } |
| 348 | 350 | // Backwards compatibility with WordPress 3.0. |
| 349 | -if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) |
|
| 351 | +if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) { |
|
| 350 | 352 | add_filter( 'gallery_style', 'twentyten_remove_gallery_css' ); |
| 353 | +} |
|
| 351 | 354 | |
| 352 | 355 | if ( ! function_exists( 'twentyten_comment' ) ) : |
| 353 | 356 | /** |
@@ -569,14 +572,16 @@ discard block |
||
| 569 | 572 | |
| 570 | 573 | if ( function_exists( 'get_post_galleries' ) ) { |
| 571 | 574 | $galleries = get_post_galleries( get_the_ID(), false ); |
| 572 | - if ( isset( $galleries[0]['ids'] ) ) |
|
| 573 | - $images = explode( ',', $galleries[0]['ids'] ); |
|
| 575 | + if ( isset( $galleries[0]['ids'] ) ) { |
|
| 576 | + $images = explode( ',', $galleries[0]['ids'] ); |
|
| 577 | + } |
|
| 574 | 578 | } else { |
| 575 | 579 | $pattern = get_shortcode_regex(); |
| 576 | 580 | preg_match( "/$pattern/s", get_the_content(), $match ); |
| 577 | 581 | $atts = shortcode_parse_atts( $match[3] ); |
| 578 | - if ( isset( $atts['ids'] ) ) |
|
| 579 | - $images = explode( ',', $atts['ids'] ); |
|
| 582 | + if ( isset( $atts['ids'] ) ) { |
|
| 583 | + $images = explode( ',', $atts['ids'] ); |
|
| 584 | + } |
|
| 580 | 585 | } |
| 581 | 586 | |
| 582 | 587 | if ( ! $images ) { |