@@ -15,21 +15,21 @@ |
||
| 15 | 15 | * |
| 16 | 16 | * If none of the sidebars have widgets, then let's bail early. |
| 17 | 17 | */ |
| 18 | -if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) ) |
|
| 18 | +if ( ! is_active_sidebar('sidebar-2') && ! is_active_sidebar('sidebar-3')) |
|
| 19 | 19 | return; |
| 20 | 20 | |
| 21 | 21 | // If we get this far, we have widgets. Let do this. |
| 22 | 22 | ?> |
| 23 | 23 | <div id="secondary" class="widget-area" role="complementary"> |
| 24 | - <?php if ( is_active_sidebar( 'sidebar-2' ) ) : ?> |
|
| 24 | + <?php if (is_active_sidebar('sidebar-2')) : ?> |
|
| 25 | 25 | <div class="first front-widgets"> |
| 26 | - <?php dynamic_sidebar( 'sidebar-2' ); ?> |
|
| 26 | + <?php dynamic_sidebar('sidebar-2'); ?> |
|
| 27 | 27 | </div><!-- .first --> |
| 28 | 28 | <?php endif; ?> |
| 29 | 29 | |
| 30 | - <?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?> |
|
| 30 | + <?php if (is_active_sidebar('sidebar-3')) : ?> |
|
| 31 | 31 | <div class="second front-widgets"> |
| 32 | - <?php dynamic_sidebar( 'sidebar-3' ); ?> |
|
| 32 | + <?php dynamic_sidebar('sidebar-3'); ?> |
|
| 33 | 33 | </div><!-- .second --> |
| 34 | 34 | <?php endif; ?> |
| 35 | 35 | </div><!-- #secondary --> |
| 36 | 36 | \ No newline at end of file |
@@ -15,8 +15,9 @@ |
||
| 15 | 15 | * |
| 16 | 16 | * If none of the sidebars have widgets, then let's bail early. |
| 17 | 17 | */ |
| 18 | -if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) ) |
|
| 18 | +if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) ) { |
|
| 19 | 19 | return; |
| 20 | +} |
|
| 20 | 21 | |
| 21 | 22 | // If we get this far, we have widgets. Let do this. |
| 22 | 23 | ?> |
@@ -19,11 +19,11 @@ discard block |
||
| 19 | 19 | <html <?php language_attributes(); ?>> |
| 20 | 20 | <!--<![endif]--> |
| 21 | 21 | <head> |
| 22 | -<meta charset="<?php bloginfo( 'charset' ); ?>" /> |
|
| 22 | +<meta charset="<?php bloginfo('charset'); ?>" /> |
|
| 23 | 23 | <meta name="viewport" content="width=device-width" /> |
| 24 | -<title><?php wp_title( '|', true, 'right' ); ?></title> |
|
| 24 | +<title><?php wp_title('|', true, 'right'); ?></title> |
|
| 25 | 25 | <link rel="profile" href="http://gmpg.org/xfn/11" /> |
| 26 | -<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> |
|
| 26 | +<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> |
|
| 27 | 27 | <?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?> |
| 28 | 28 | <!--[if lt IE 9]> |
| 29 | 29 | <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script> |
@@ -35,18 +35,18 @@ discard block |
||
| 35 | 35 | <div id="page" class="hfeed site"> |
| 36 | 36 | <header id="masthead" class="site-header" role="banner"> |
| 37 | 37 | <hgroup> |
| 38 | - <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> |
|
| 39 | - <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2> |
|
| 38 | + <h1 class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>" title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>" rel="home"><?php bloginfo('name'); ?></a></h1> |
|
| 39 | + <h2 class="site-description"><?php bloginfo('description'); ?></h2> |
|
| 40 | 40 | </hgroup> |
| 41 | 41 | |
| 42 | 42 | <nav id="site-navigation" class="main-navigation" role="navigation"> |
| 43 | - <button class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></button> |
|
| 44 | - <a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a> |
|
| 45 | - <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?> |
|
| 43 | + <button class="menu-toggle"><?php _e('Menu', 'twentytwelve'); ?></button> |
|
| 44 | + <a class="assistive-text" href="#content" title="<?php esc_attr_e('Skip to content', 'twentytwelve'); ?>"><?php _e('Skip to content', 'twentytwelve'); ?></a> |
|
| 45 | + <?php wp_nav_menu(array('theme_location' => 'primary', 'menu_class' => 'nav-menu')); ?> |
|
| 46 | 46 | </nav><!-- #site-navigation --> |
| 47 | 47 | |
| 48 | - <?php if ( get_header_image() ) : ?> |
|
| 49 | - <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /></a> |
|
| 48 | + <?php if (get_header_image()) : ?> |
|
| 49 | + <a href="<?php echo esc_url(home_url('/')); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo esc_attr(get_custom_header()->width); ?>" height="<?php echo esc_attr(get_custom_header()->height); ?>" alt="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>" /></a> |
|
| 50 | 50 | <?php endif; ?> |
| 51 | 51 | </header><!-- #masthead --> |
| 52 | 52 | |
@@ -17,19 +17,19 @@ |
||
| 17 | 17 | <div id="primary" class="site-content"> |
| 18 | 18 | <div id="content" role="main"> |
| 19 | 19 | |
| 20 | - <?php while ( have_posts() ) : the_post(); ?> |
|
| 21 | - <?php if ( has_post_thumbnail() ) : ?> |
|
| 20 | + <?php while (have_posts()) : the_post(); ?> |
|
| 21 | + <?php if (has_post_thumbnail()) : ?> |
|
| 22 | 22 | <div class="entry-page-image"> |
| 23 | 23 | <?php the_post_thumbnail(); ?> |
| 24 | 24 | </div><!-- .entry-page-image --> |
| 25 | 25 | <?php endif; ?> |
| 26 | 26 | |
| 27 | - <?php get_template_part( 'content', 'page' ); ?> |
|
| 27 | + <?php get_template_part('content', 'page'); ?> |
|
| 28 | 28 | |
| 29 | 29 | <?php endwhile; // end of the loop. ?> |
| 30 | 30 | |
| 31 | 31 | </div><!-- #content --> |
| 32 | 32 | </div><!-- #primary --> |
| 33 | 33 | |
| 34 | -<?php get_sidebar( 'front' ); ?> |
|
| 34 | +<?php get_sidebar('front'); ?> |
|
| 35 | 35 | <?php get_footer(); ?> |
| 36 | 36 | \ No newline at end of file |
@@ -10,8 +10,8 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | ?> |
| 12 | 12 | |
| 13 | - <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?> |
|
| 13 | + <?php if (is_active_sidebar('sidebar-1')) : ?> |
|
| 14 | 14 | <div id="secondary" class="widget-area" role="complementary"> |
| 15 | - <?php dynamic_sidebar( 'sidebar-1' ); ?> |
|
| 15 | + <?php dynamic_sidebar('sidebar-1'); ?> |
|
| 16 | 16 | </div><!-- #secondary --> |
| 17 | 17 | <?php endif; ?> |
| 18 | 18 | \ No newline at end of file |
@@ -18,39 +18,39 @@ |
||
| 18 | 18 | |
| 19 | 19 | <div id="primary" class="site-content"> |
| 20 | 20 | <div id="content" role="main"> |
| 21 | - <?php if ( have_posts() ) : ?> |
|
| 21 | + <?php if (have_posts()) : ?> |
|
| 22 | 22 | |
| 23 | 23 | <?php /* Start the Loop */ ?> |
| 24 | - <?php while ( have_posts() ) : the_post(); ?> |
|
| 25 | - <?php get_template_part( 'content', get_post_format() ); ?> |
|
| 24 | + <?php while (have_posts()) : the_post(); ?> |
|
| 25 | + <?php get_template_part('content', get_post_format()); ?> |
|
| 26 | 26 | <?php endwhile; ?> |
| 27 | 27 | |
| 28 | - <?php twentytwelve_content_nav( 'nav-below' ); ?> |
|
| 28 | + <?php twentytwelve_content_nav('nav-below'); ?> |
|
| 29 | 29 | |
| 30 | 30 | <?php else : ?> |
| 31 | 31 | |
| 32 | 32 | <article id="post-0" class="post no-results not-found"> |
| 33 | 33 | |
| 34 | - <?php if ( current_user_can( 'edit_posts' ) ) : |
|
| 34 | + <?php if (current_user_can('edit_posts')) : |
|
| 35 | 35 | // Show a different message to a logged-in user who can add posts. |
| 36 | 36 | ?> |
| 37 | 37 | <header class="entry-header"> |
| 38 | - <h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1> |
|
| 38 | + <h1 class="entry-title"><?php _e('No posts to display', 'twentytwelve'); ?></h1> |
|
| 39 | 39 | </header> |
| 40 | 40 | |
| 41 | 41 | <div class="entry-content"> |
| 42 | - <p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p> |
|
| 42 | + <p><?php printf(__('Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve'), admin_url('post-new.php')); ?></p> |
|
| 43 | 43 | </div><!-- .entry-content --> |
| 44 | 44 | |
| 45 | 45 | <?php else : |
| 46 | 46 | // Show the default message to everyone else. |
| 47 | 47 | ?> |
| 48 | 48 | <header class="entry-header"> |
| 49 | - <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1> |
|
| 49 | + <h1 class="entry-title"><?php _e('Nothing Found', 'twentytwelve'); ?></h1> |
|
| 50 | 50 | </header> |
| 51 | 51 | |
| 52 | 52 | <div class="entry-content"> |
| 53 | - <p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p> |
|
| 53 | + <p><?php _e('Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve'); ?></p> |
|
| 54 | 54 | <?php get_search_form(); ?> |
| 55 | 55 | </div><!-- .entry-content --> |
| 56 | 56 | <?php endif; // end current_user_can() check ?> |
@@ -27,7 +27,8 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | <?php twentytwelve_content_nav( 'nav-below' ); ?> |
| 29 | 29 | |
| 30 | - <?php else : ?> |
|
| 30 | + <?php else { |
|
| 31 | + : ?> |
|
| 31 | 32 | |
| 32 | 33 | <article id="post-0" class="post no-results not-found"> |
| 33 | 34 | |
@@ -35,18 +36,23 @@ discard block |
||
| 35 | 36 | // Show a different message to a logged-in user who can add posts. |
| 36 | 37 | ?> |
| 37 | 38 | <header class="entry-header"> |
| 38 | - <h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1> |
|
| 39 | + <h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); |
|
| 40 | +} |
|
| 41 | +?></h1> |
|
| 39 | 42 | </header> |
| 40 | 43 | |
| 41 | 44 | <div class="entry-content"> |
| 42 | 45 | <p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p> |
| 43 | 46 | </div><!-- .entry-content --> |
| 44 | 47 | |
| 45 | - <?php else : |
|
| 48 | + <?php else { |
|
| 49 | + : |
|
| 46 | 50 | // Show the default message to everyone else. |
| 47 | 51 | ?> |
| 48 | 52 | <header class="entry-header"> |
| 49 | - <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1> |
|
| 53 | + <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); |
|
| 54 | +} |
|
| 55 | +?></h1> |
|
| 50 | 56 | </header> |
| 51 | 57 | |
| 52 | 58 | <div class="entry-content"> |
@@ -23,8 +23,9 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | 25 | // Set up the content width value based on the theme's design and stylesheet. |
| 26 | -if ( ! isset( $content_width ) ) |
|
| 26 | +if ( ! isset( $content_width ) ) { |
|
| 27 | 27 | $content_width = 625; |
| 28 | +} |
|
| 28 | 29 | |
| 29 | 30 | /** |
| 30 | 31 | * Twenty Twelve setup. |
@@ -106,12 +107,13 @@ discard block |
||
| 106 | 107 | */ |
| 107 | 108 | $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' ); |
| 108 | 109 | |
| 109 | - if ( 'cyrillic' == $subset ) |
|
| 110 | - $subsets .= ',cyrillic,cyrillic-ext'; |
|
| 111 | - elseif ( 'greek' == $subset ) |
|
| 112 | - $subsets .= ',greek,greek-ext'; |
|
| 113 | - elseif ( 'vietnamese' == $subset ) |
|
| 114 | - $subsets .= ',vietnamese'; |
|
| 110 | + if ( 'cyrillic' == $subset ) { |
|
| 111 | + $subsets .= ',cyrillic,cyrillic-ext'; |
|
| 112 | + } elseif ( 'greek' == $subset ) { |
|
| 113 | + $subsets .= ',greek,greek-ext'; |
|
| 114 | + } elseif ( 'vietnamese' == $subset ) { |
|
| 115 | + $subsets .= ',vietnamese'; |
|
| 116 | + } |
|
| 115 | 117 | |
| 116 | 118 | $query_args = array( |
| 117 | 119 | 'family' => 'Open+Sans:400italic,700italic,400,700', |
@@ -135,15 +137,17 @@ discard block |
||
| 135 | 137 | * Adds JavaScript to pages with the comment form to support |
| 136 | 138 | * sites with threaded comments (when in use). |
| 137 | 139 | */ |
| 138 | - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) |
|
| 139 | - wp_enqueue_script( 'comment-reply' ); |
|
| 140 | + if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { |
|
| 141 | + wp_enqueue_script( 'comment-reply' ); |
|
| 142 | + } |
|
| 140 | 143 | |
| 141 | 144 | // Adds JavaScript for handling the navigation menu hide-and-show behavior. |
| 142 | 145 | wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140711', true ); |
| 143 | 146 | |
| 144 | 147 | $font_url = twentytwelve_get_font_url(); |
| 145 | - if ( ! empty( $font_url ) ) |
|
| 146 | - wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null ); |
|
| 148 | + if ( ! empty( $font_url ) ) { |
|
| 149 | + wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null ); |
|
| 150 | + } |
|
| 147 | 151 | |
| 148 | 152 | // Loads our main stylesheet. |
| 149 | 153 | wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() ); |
@@ -169,11 +173,13 @@ discard block |
||
| 169 | 173 | function twentytwelve_mce_css( $mce_css ) { |
| 170 | 174 | $font_url = twentytwelve_get_font_url(); |
| 171 | 175 | |
| 172 | - if ( empty( $font_url ) ) |
|
| 173 | - return $mce_css; |
|
| 176 | + if ( empty( $font_url ) ) { |
|
| 177 | + return $mce_css; |
|
| 178 | + } |
|
| 174 | 179 | |
| 175 | - if ( ! empty( $mce_css ) ) |
|
| 176 | - $mce_css .= ','; |
|
| 180 | + if ( ! empty( $mce_css ) ) { |
|
| 181 | + $mce_css .= ','; |
|
| 182 | + } |
|
| 177 | 183 | |
| 178 | 184 | $mce_css .= esc_url_raw( str_replace( ',', '%2C', $font_url ) ); |
| 179 | 185 | |
@@ -196,20 +202,23 @@ discard block |
||
| 196 | 202 | function twentytwelve_wp_title( $title, $sep ) { |
| 197 | 203 | global $paged, $page; |
| 198 | 204 | |
| 199 | - if ( is_feed() ) |
|
| 200 | - return $title; |
|
| 205 | + if ( is_feed() ) { |
|
| 206 | + return $title; |
|
| 207 | + } |
|
| 201 | 208 | |
| 202 | 209 | // Add the site name. |
| 203 | 210 | $title .= get_bloginfo( 'name', 'display' ); |
| 204 | 211 | |
| 205 | 212 | // Add the site description for the home/front page. |
| 206 | 213 | $site_description = get_bloginfo( 'description', 'display' ); |
| 207 | - if ( $site_description && ( is_home() || is_front_page() ) ) |
|
| 208 | - $title = "$title $sep $site_description"; |
|
| 214 | + if ( $site_description && ( is_home() || is_front_page() ) ) { |
|
| 215 | + $title = "$title $sep $site_description"; |
|
| 216 | + } |
|
| 209 | 217 | |
| 210 | 218 | // Add a page number if necessary. |
| 211 | - if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) |
|
| 212 | - $title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) ); |
|
| 219 | + if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { |
|
| 220 | + $title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) ); |
|
| 221 | + } |
|
| 213 | 222 | |
| 214 | 223 | return $title; |
| 215 | 224 | } |
@@ -223,8 +232,9 @@ discard block |
||
| 223 | 232 | * @since Twenty Twelve 1.0 |
| 224 | 233 | */ |
| 225 | 234 | function twentytwelve_page_menu_args( $args ) { |
| 226 | - if ( ! isset( $args['show_home'] ) ) |
|
| 227 | - $args['show_home'] = true; |
|
| 235 | + if ( ! isset( $args['show_home'] ) ) { |
|
| 236 | + $args['show_home'] = true; |
|
| 237 | + } |
|
| 228 | 238 | return $args; |
| 229 | 239 | } |
| 230 | 240 | add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' ); |
@@ -422,30 +432,36 @@ discard block |
||
| 422 | 432 | $background_color = get_background_color(); |
| 423 | 433 | $background_image = get_background_image(); |
| 424 | 434 | |
| 425 | - if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) ) |
|
| 426 | - $classes[] = 'full-width'; |
|
| 435 | + if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) ) { |
|
| 436 | + $classes[] = 'full-width'; |
|
| 437 | + } |
|
| 427 | 438 | |
| 428 | 439 | if ( is_page_template( 'page-templates/front-page.php' ) ) { |
| 429 | 440 | $classes[] = 'template-front-page'; |
| 430 | - if ( has_post_thumbnail() ) |
|
| 431 | - $classes[] = 'has-post-thumbnail'; |
|
| 432 | - if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) ) |
|
| 433 | - $classes[] = 'two-sidebars'; |
|
| 441 | + if ( has_post_thumbnail() ) { |
|
| 442 | + $classes[] = 'has-post-thumbnail'; |
|
| 443 | + } |
|
| 444 | + if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) ) { |
|
| 445 | + $classes[] = 'two-sidebars'; |
|
| 446 | + } |
|
| 434 | 447 | } |
| 435 | 448 | |
| 436 | 449 | if ( empty( $background_image ) ) { |
| 437 | - if ( empty( $background_color ) ) |
|
| 438 | - $classes[] = 'custom-background-empty'; |
|
| 439 | - elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) ) |
|
| 440 | - $classes[] = 'custom-background-white'; |
|
| 450 | + if ( empty( $background_color ) ) { |
|
| 451 | + $classes[] = 'custom-background-empty'; |
|
| 452 | + } elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) ) { |
|
| 453 | + $classes[] = 'custom-background-white'; |
|
| 454 | + } |
|
| 441 | 455 | } |
| 442 | 456 | |
| 443 | 457 | // Enable custom font class only if the font CSS is queued to load. |
| 444 | - if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) ) |
|
| 445 | - $classes[] = 'custom-font-enabled'; |
|
| 458 | + if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) ) { |
|
| 459 | + $classes[] = 'custom-font-enabled'; |
|
| 460 | + } |
|
| 446 | 461 | |
| 447 | - if ( ! is_multi_author() ) |
|
| 448 | - $classes[] = 'single-author'; |
|
| 462 | + if ( ! is_multi_author() ) { |
|
| 463 | + $classes[] = 'single-author'; |
|
| 464 | + } |
|
| 449 | 465 | |
| 450 | 466 | return $classes; |
| 451 | 467 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | 25 | // Set up the content width value based on the theme's design and stylesheet. |
| 26 | -if ( ! isset( $content_width ) ) |
|
| 26 | +if ( ! isset($content_width)) |
|
| 27 | 27 | $content_width = 625; |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -49,41 +49,41 @@ discard block |
||
| 49 | 49 | * If you're building a theme based on Twenty Twelve, use a find and replace |
| 50 | 50 | * to change 'twentytwelve' to the name of your theme in all the template files. |
| 51 | 51 | */ |
| 52 | - load_theme_textdomain( 'twentytwelve' ); |
|
| 52 | + load_theme_textdomain('twentytwelve'); |
|
| 53 | 53 | |
| 54 | 54 | // This theme styles the visual editor with editor-style.css to match the theme style. |
| 55 | 55 | add_editor_style(); |
| 56 | 56 | |
| 57 | 57 | // Adds RSS feed links to <head> for posts and comments. |
| 58 | - add_theme_support( 'automatic-feed-links' ); |
|
| 58 | + add_theme_support('automatic-feed-links'); |
|
| 59 | 59 | |
| 60 | 60 | // This theme supports a variety of post formats. |
| 61 | - add_theme_support( 'post-formats', array( 'aside', 'image', 'link', 'quote', 'status' ) ); |
|
| 61 | + add_theme_support('post-formats', array('aside', 'image', 'link', 'quote', 'status')); |
|
| 62 | 62 | |
| 63 | 63 | // This theme uses wp_nav_menu() in one location. |
| 64 | - register_nav_menu( 'primary', __( 'Primary Menu', 'twentytwelve' ) ); |
|
| 64 | + register_nav_menu('primary', __('Primary Menu', 'twentytwelve')); |
|
| 65 | 65 | |
| 66 | 66 | /* |
| 67 | 67 | * This theme supports custom background color and image, |
| 68 | 68 | * and here we also set up the default background color. |
| 69 | 69 | */ |
| 70 | - add_theme_support( 'custom-background', array( |
|
| 70 | + add_theme_support('custom-background', array( |
|
| 71 | 71 | 'default-color' => 'e6e6e6', |
| 72 | - ) ); |
|
| 72 | + )); |
|
| 73 | 73 | |
| 74 | 74 | // This theme uses a custom image size for featured images, displayed on "standard" posts. |
| 75 | - add_theme_support( 'post-thumbnails' ); |
|
| 76 | - set_post_thumbnail_size( 624, 9999 ); // Unlimited height, soft crop |
|
| 75 | + add_theme_support('post-thumbnails'); |
|
| 76 | + set_post_thumbnail_size(624, 9999); // Unlimited height, soft crop |
|
| 77 | 77 | |
| 78 | 78 | // Indicate widget sidebars can use selective refresh in the Customizer. |
| 79 | - add_theme_support( 'customize-selective-refresh-widgets' ); |
|
| 79 | + add_theme_support('customize-selective-refresh-widgets'); |
|
| 80 | 80 | } |
| 81 | -add_action( 'after_setup_theme', 'twentytwelve_setup' ); |
|
| 81 | +add_action('after_setup_theme', 'twentytwelve_setup'); |
|
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * Add support for a custom header image. |
| 85 | 85 | */ |
| 86 | -require( get_template_directory() . '/inc/custom-header.php' ); |
|
| 86 | +require(get_template_directory().'/inc/custom-header.php'); |
|
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | 89 | * Return the Google font stylesheet URL if available. |
@@ -101,26 +101,26 @@ discard block |
||
| 101 | 101 | /* translators: If there are characters in your language that are not supported |
| 102 | 102 | * by Open Sans, translate this to 'off'. Do not translate into your own language. |
| 103 | 103 | */ |
| 104 | - if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'twentytwelve' ) ) { |
|
| 104 | + if ('off' !== _x('on', 'Open Sans font: on or off', 'twentytwelve')) { |
|
| 105 | 105 | $subsets = 'latin,latin-ext'; |
| 106 | 106 | |
| 107 | 107 | /* translators: To add an additional Open Sans character subset specific to your language, |
| 108 | 108 | * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. |
| 109 | 109 | */ |
| 110 | - $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' ); |
|
| 110 | + $subset = _x('no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve'); |
|
| 111 | 111 | |
| 112 | - if ( 'cyrillic' == $subset ) |
|
| 112 | + if ('cyrillic' == $subset) |
|
| 113 | 113 | $subsets .= ',cyrillic,cyrillic-ext'; |
| 114 | - elseif ( 'greek' == $subset ) |
|
| 114 | + elseif ('greek' == $subset) |
|
| 115 | 115 | $subsets .= ',greek,greek-ext'; |
| 116 | - elseif ( 'vietnamese' == $subset ) |
|
| 116 | + elseif ('vietnamese' == $subset) |
|
| 117 | 117 | $subsets .= ',vietnamese'; |
| 118 | 118 | |
| 119 | 119 | $query_args = array( |
| 120 | 120 | 'family' => 'Open+Sans:400italic,700italic,400,700', |
| 121 | 121 | 'subset' => $subsets, |
| 122 | 122 | ); |
| 123 | - $font_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); |
|
| 123 | + $font_url = add_query_arg($query_args, 'https://fonts.googleapis.com/css'); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | return $font_url; |
@@ -138,24 +138,24 @@ discard block |
||
| 138 | 138 | * Adds JavaScript to pages with the comment form to support |
| 139 | 139 | * sites with threaded comments (when in use). |
| 140 | 140 | */ |
| 141 | - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) |
|
| 142 | - wp_enqueue_script( 'comment-reply' ); |
|
| 141 | + if (is_singular() && comments_open() && get_option('thread_comments')) |
|
| 142 | + wp_enqueue_script('comment-reply'); |
|
| 143 | 143 | |
| 144 | 144 | // Adds JavaScript for handling the navigation menu hide-and-show behavior. |
| 145 | - wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140711', true ); |
|
| 145 | + wp_enqueue_script('twentytwelve-navigation', get_template_directory_uri().'/js/navigation.js', array('jquery'), '20140711', true); |
|
| 146 | 146 | |
| 147 | 147 | $font_url = twentytwelve_get_font_url(); |
| 148 | - if ( ! empty( $font_url ) ) |
|
| 149 | - wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null ); |
|
| 148 | + if ( ! empty($font_url)) |
|
| 149 | + wp_enqueue_style('twentytwelve-fonts', esc_url_raw($font_url), array(), null); |
|
| 150 | 150 | |
| 151 | 151 | // Loads our main stylesheet. |
| 152 | - wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() ); |
|
| 152 | + wp_enqueue_style('twentytwelve-style', get_stylesheet_uri()); |
|
| 153 | 153 | |
| 154 | 154 | // Loads the Internet Explorer specific stylesheet. |
| 155 | - wp_enqueue_style( 'twentytwelve-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentytwelve-style' ), '20121010' ); |
|
| 156 | - $wp_styles->add_data( 'twentytwelve-ie', 'conditional', 'lt IE 9' ); |
|
| 155 | + wp_enqueue_style('twentytwelve-ie', get_template_directory_uri().'/css/ie.css', array('twentytwelve-style'), '20121010'); |
|
| 156 | + $wp_styles->add_data('twentytwelve-ie', 'conditional', 'lt IE 9'); |
|
| 157 | 157 | } |
| 158 | -add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' ); |
|
| 158 | +add_action('wp_enqueue_scripts', 'twentytwelve_scripts_styles'); |
|
| 159 | 159 | |
| 160 | 160 | /** |
| 161 | 161 | * Add preconnect for Google Fonts. |
@@ -166,9 +166,9 @@ discard block |
||
| 166 | 166 | * @param string $relation_type The relation type the URLs are printed. |
| 167 | 167 | * @return array URLs to print for resource hints. |
| 168 | 168 | */ |
| 169 | -function twentytwelve_resource_hints( $urls, $relation_type ) { |
|
| 170 | - if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) && 'preconnect' === $relation_type ) { |
|
| 171 | - if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { |
|
| 169 | +function twentytwelve_resource_hints($urls, $relation_type) { |
|
| 170 | + if (wp_style_is('twentytwelve-fonts', 'queue') && 'preconnect' === $relation_type) { |
|
| 171 | + if (version_compare($GLOBALS['wp_version'], '4.7-alpha', '>=')) { |
|
| 172 | 172 | $urls[] = array( |
| 173 | 173 | 'href' => 'https://fonts.gstatic.com', |
| 174 | 174 | 'crossorigin', |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | return $urls; |
| 182 | 182 | } |
| 183 | -add_filter( 'wp_resource_hints', 'twentytwelve_resource_hints', 10, 2 ); |
|
| 183 | +add_filter('wp_resource_hints', 'twentytwelve_resource_hints', 10, 2); |
|
| 184 | 184 | |
| 185 | 185 | /** |
| 186 | 186 | * Filter TinyMCE CSS path to include Google Fonts. |
@@ -194,20 +194,20 @@ discard block |
||
| 194 | 194 | * @param string $mce_css CSS path to load in TinyMCE. |
| 195 | 195 | * @return string Filtered CSS path. |
| 196 | 196 | */ |
| 197 | -function twentytwelve_mce_css( $mce_css ) { |
|
| 197 | +function twentytwelve_mce_css($mce_css) { |
|
| 198 | 198 | $font_url = twentytwelve_get_font_url(); |
| 199 | 199 | |
| 200 | - if ( empty( $font_url ) ) |
|
| 200 | + if (empty($font_url)) |
|
| 201 | 201 | return $mce_css; |
| 202 | 202 | |
| 203 | - if ( ! empty( $mce_css ) ) |
|
| 203 | + if ( ! empty($mce_css)) |
|
| 204 | 204 | $mce_css .= ','; |
| 205 | 205 | |
| 206 | - $mce_css .= esc_url_raw( str_replace( ',', '%2C', $font_url ) ); |
|
| 206 | + $mce_css .= esc_url_raw(str_replace(',', '%2C', $font_url)); |
|
| 207 | 207 | |
| 208 | 208 | return $mce_css; |
| 209 | 209 | } |
| 210 | -add_filter( 'mce_css', 'twentytwelve_mce_css' ); |
|
| 210 | +add_filter('mce_css', 'twentytwelve_mce_css'); |
|
| 211 | 211 | |
| 212 | 212 | /** |
| 213 | 213 | * Filter the page title. |
@@ -221,27 +221,27 @@ discard block |
||
| 221 | 221 | * @param string $sep Optional separator. |
| 222 | 222 | * @return string Filtered title. |
| 223 | 223 | */ |
| 224 | -function twentytwelve_wp_title( $title, $sep ) { |
|
| 224 | +function twentytwelve_wp_title($title, $sep) { |
|
| 225 | 225 | global $paged, $page; |
| 226 | 226 | |
| 227 | - if ( is_feed() ) |
|
| 227 | + if (is_feed()) |
|
| 228 | 228 | return $title; |
| 229 | 229 | |
| 230 | 230 | // Add the site name. |
| 231 | - $title .= get_bloginfo( 'name', 'display' ); |
|
| 231 | + $title .= get_bloginfo('name', 'display'); |
|
| 232 | 232 | |
| 233 | 233 | // Add the site description for the home/front page. |
| 234 | - $site_description = get_bloginfo( 'description', 'display' ); |
|
| 235 | - if ( $site_description && ( is_home() || is_front_page() ) ) |
|
| 234 | + $site_description = get_bloginfo('description', 'display'); |
|
| 235 | + if ($site_description && (is_home() || is_front_page())) |
|
| 236 | 236 | $title = "$title $sep $site_description"; |
| 237 | 237 | |
| 238 | 238 | // Add a page number if necessary. |
| 239 | - if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) |
|
| 240 | - $title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) ); |
|
| 239 | + if (($paged >= 2 || $page >= 2) && ! is_404()) |
|
| 240 | + $title = "$title $sep ".sprintf(__('Page %s', 'twentytwelve'), max($paged, $page)); |
|
| 241 | 241 | |
| 242 | 242 | return $title; |
| 243 | 243 | } |
| 244 | -add_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 ); |
|
| 244 | +add_filter('wp_title', 'twentytwelve_wp_title', 10, 2); |
|
| 245 | 245 | |
| 246 | 246 | /** |
| 247 | 247 | * Filter the page menu arguments. |
@@ -250,12 +250,12 @@ discard block |
||
| 250 | 250 | * |
| 251 | 251 | * @since Twenty Twelve 1.0 |
| 252 | 252 | */ |
| 253 | -function twentytwelve_page_menu_args( $args ) { |
|
| 254 | - if ( ! isset( $args['show_home'] ) ) |
|
| 253 | +function twentytwelve_page_menu_args($args) { |
|
| 254 | + if ( ! isset($args['show_home'])) |
|
| 255 | 255 | $args['show_home'] = true; |
| 256 | 256 | return $args; |
| 257 | 257 | } |
| 258 | -add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' ); |
|
| 258 | +add_filter('wp_page_menu_args', 'twentytwelve_page_menu_args'); |
|
| 259 | 259 | |
| 260 | 260 | /** |
| 261 | 261 | * Register sidebars. |
@@ -265,58 +265,58 @@ discard block |
||
| 265 | 265 | * @since Twenty Twelve 1.0 |
| 266 | 266 | */ |
| 267 | 267 | function twentytwelve_widgets_init() { |
| 268 | - register_sidebar( array( |
|
| 269 | - 'name' => __( 'Main Sidebar', 'twentytwelve' ), |
|
| 268 | + register_sidebar(array( |
|
| 269 | + 'name' => __('Main Sidebar', 'twentytwelve'), |
|
| 270 | 270 | 'id' => 'sidebar-1', |
| 271 | - 'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'twentytwelve' ), |
|
| 271 | + 'description' => __('Appears on posts and pages except the optional Front Page template, which has its own widgets', 'twentytwelve'), |
|
| 272 | 272 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
| 273 | 273 | 'after_widget' => '</aside>', |
| 274 | 274 | 'before_title' => '<h3 class="widget-title">', |
| 275 | 275 | 'after_title' => '</h3>', |
| 276 | - ) ); |
|
| 276 | + )); |
|
| 277 | 277 | |
| 278 | - register_sidebar( array( |
|
| 279 | - 'name' => __( 'First Front Page Widget Area', 'twentytwelve' ), |
|
| 278 | + register_sidebar(array( |
|
| 279 | + 'name' => __('First Front Page Widget Area', 'twentytwelve'), |
|
| 280 | 280 | 'id' => 'sidebar-2', |
| 281 | - 'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ), |
|
| 281 | + 'description' => __('Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve'), |
|
| 282 | 282 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
| 283 | 283 | 'after_widget' => '</aside>', |
| 284 | 284 | 'before_title' => '<h3 class="widget-title">', |
| 285 | 285 | 'after_title' => '</h3>', |
| 286 | - ) ); |
|
| 286 | + )); |
|
| 287 | 287 | |
| 288 | - register_sidebar( array( |
|
| 289 | - 'name' => __( 'Second Front Page Widget Area', 'twentytwelve' ), |
|
| 288 | + register_sidebar(array( |
|
| 289 | + 'name' => __('Second Front Page Widget Area', 'twentytwelve'), |
|
| 290 | 290 | 'id' => 'sidebar-3', |
| 291 | - 'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ), |
|
| 291 | + 'description' => __('Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve'), |
|
| 292 | 292 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
| 293 | 293 | 'after_widget' => '</aside>', |
| 294 | 294 | 'before_title' => '<h3 class="widget-title">', |
| 295 | 295 | 'after_title' => '</h3>', |
| 296 | - ) ); |
|
| 296 | + )); |
|
| 297 | 297 | } |
| 298 | -add_action( 'widgets_init', 'twentytwelve_widgets_init' ); |
|
| 298 | +add_action('widgets_init', 'twentytwelve_widgets_init'); |
|
| 299 | 299 | |
| 300 | -if ( ! function_exists( 'twentytwelve_content_nav' ) ) : |
|
| 300 | +if ( ! function_exists('twentytwelve_content_nav')) : |
|
| 301 | 301 | /** |
| 302 | 302 | * Displays navigation to next/previous pages when applicable. |
| 303 | 303 | * |
| 304 | 304 | * @since Twenty Twelve 1.0 |
| 305 | 305 | */ |
| 306 | -function twentytwelve_content_nav( $html_id ) { |
|
| 306 | +function twentytwelve_content_nav($html_id) { |
|
| 307 | 307 | global $wp_query; |
| 308 | 308 | |
| 309 | - if ( $wp_query->max_num_pages > 1 ) : ?> |
|
| 310 | - <nav id="<?php echo esc_attr( $html_id ); ?>" class="navigation" role="navigation"> |
|
| 311 | - <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3> |
|
| 312 | - <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentytwelve' ) ); ?></div> |
|
| 313 | - <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?></div> |
|
| 309 | + if ($wp_query->max_num_pages > 1) : ?> |
|
| 310 | + <nav id="<?php echo esc_attr($html_id); ?>" class="navigation" role="navigation"> |
|
| 311 | + <h3 class="assistive-text"><?php _e('Post navigation', 'twentytwelve'); ?></h3> |
|
| 312 | + <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">←</span> Older posts', 'twentytwelve')); ?></div> |
|
| 313 | + <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">→</span>', 'twentytwelve')); ?></div> |
|
| 314 | 314 | </nav><!-- .navigation --> |
| 315 | 315 | <?php endif; |
| 316 | 316 | } |
| 317 | 317 | endif; |
| 318 | 318 | |
| 319 | -if ( ! function_exists( 'twentytwelve_comment' ) ) : |
|
| 319 | +if ( ! function_exists('twentytwelve_comment')) : |
|
| 320 | 320 | /** |
| 321 | 321 | * Template for comments and pingbacks. |
| 322 | 322 | * |
@@ -327,15 +327,15 @@ discard block |
||
| 327 | 327 | * |
| 328 | 328 | * @since Twenty Twelve 1.0 |
| 329 | 329 | */ |
| 330 | -function twentytwelve_comment( $comment, $args, $depth ) { |
|
| 330 | +function twentytwelve_comment($comment, $args, $depth) { |
|
| 331 | 331 | $GLOBALS['comment'] = $comment; |
| 332 | - switch ( $comment->comment_type ) : |
|
| 332 | + switch ($comment->comment_type) : |
|
| 333 | 333 | case 'pingback' : |
| 334 | 334 | case 'trackback' : |
| 335 | 335 | // Display trackbacks differently than normal comments. |
| 336 | 336 | ?> |
| 337 | 337 | <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>"> |
| 338 | - <p><?php _e( 'Pingback:', 'twentytwelve' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?></p> |
|
| 338 | + <p><?php _e('Pingback:', 'twentytwelve'); ?> <?php comment_author_link(); ?> <?php edit_comment_link(__('(Edit)', 'twentytwelve'), '<span class="edit-link">', '</span>'); ?></p> |
|
| 339 | 339 | <?php |
| 340 | 340 | break; |
| 341 | 341 | default : |
@@ -346,32 +346,32 @@ discard block |
||
| 346 | 346 | <article id="comment-<?php comment_ID(); ?>" class="comment"> |
| 347 | 347 | <header class="comment-meta comment-author vcard"> |
| 348 | 348 | <?php |
| 349 | - echo get_avatar( $comment, 44 ); |
|
| 350 | - printf( '<cite><b class="fn">%1$s</b> %2$s</cite>', |
|
| 349 | + echo get_avatar($comment, 44); |
|
| 350 | + printf('<cite><b class="fn">%1$s</b> %2$s</cite>', |
|
| 351 | 351 | get_comment_author_link(), |
| 352 | 352 | // If current post author is also comment author, make it known visually. |
| 353 | - ( $comment->user_id === $post->post_author ) ? '<span>' . __( 'Post author', 'twentytwelve' ) . '</span>' : '' |
|
| 353 | + ($comment->user_id === $post->post_author) ? '<span>'.__('Post author', 'twentytwelve').'</span>' : '' |
|
| 354 | 354 | ); |
| 355 | - printf( '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>', |
|
| 356 | - esc_url( get_comment_link( $comment->comment_ID ) ), |
|
| 357 | - get_comment_time( 'c' ), |
|
| 355 | + printf('<a href="%1$s"><time datetime="%2$s">%3$s</time></a>', |
|
| 356 | + esc_url(get_comment_link($comment->comment_ID)), |
|
| 357 | + get_comment_time('c'), |
|
| 358 | 358 | /* translators: 1: date, 2: time */ |
| 359 | - sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() ) |
|
| 359 | + sprintf(__('%1$s at %2$s', 'twentytwelve'), get_comment_date(), get_comment_time()) |
|
| 360 | 360 | ); |
| 361 | 361 | ?> |
| 362 | 362 | </header><!-- .comment-meta --> |
| 363 | 363 | |
| 364 | - <?php if ( '0' == $comment->comment_approved ) : ?> |
|
| 365 | - <p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentytwelve' ); ?></p> |
|
| 364 | + <?php if ('0' == $comment->comment_approved) : ?> |
|
| 365 | + <p class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.', 'twentytwelve'); ?></p> |
|
| 366 | 366 | <?php endif; ?> |
| 367 | 367 | |
| 368 | 368 | <section class="comment-content comment"> |
| 369 | 369 | <?php comment_text(); ?> |
| 370 | - <?php edit_comment_link( __( 'Edit', 'twentytwelve' ), '<p class="edit-link">', '</p>' ); ?> |
|
| 370 | + <?php edit_comment_link(__('Edit', 'twentytwelve'), '<p class="edit-link">', '</p>'); ?> |
|
| 371 | 371 | </section><!-- .comment-content --> |
| 372 | 372 | |
| 373 | 373 | <div class="reply"> |
| 374 | - <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'twentytwelve' ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> |
|
| 374 | + <?php comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'twentytwelve'), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> |
|
| 375 | 375 | </div><!-- .reply --> |
| 376 | 376 | </article><!-- #comment-## --> |
| 377 | 377 | <?php |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | } |
| 381 | 381 | endif; |
| 382 | 382 | |
| 383 | -if ( ! function_exists( 'twentytwelve_entry_meta' ) ) : |
|
| 383 | +if ( ! function_exists('twentytwelve_entry_meta')) : |
|
| 384 | 384 | /** |
| 385 | 385 | * Set up post entry meta. |
| 386 | 386 | * |
@@ -392,31 +392,31 @@ discard block |
||
| 392 | 392 | */ |
| 393 | 393 | function twentytwelve_entry_meta() { |
| 394 | 394 | // Translators: used between list items, there is a space after the comma. |
| 395 | - $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) ); |
|
| 395 | + $categories_list = get_the_category_list(__(', ', 'twentytwelve')); |
|
| 396 | 396 | |
| 397 | 397 | // Translators: used between list items, there is a space after the comma. |
| 398 | - $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) ); |
|
| 398 | + $tag_list = get_the_tag_list('', __(', ', 'twentytwelve')); |
|
| 399 | 399 | |
| 400 | - $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>', |
|
| 401 | - esc_url( get_permalink() ), |
|
| 402 | - esc_attr( get_the_time() ), |
|
| 403 | - esc_attr( get_the_date( 'c' ) ), |
|
| 404 | - esc_html( get_the_date() ) |
|
| 400 | + $date = sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>', |
|
| 401 | + esc_url(get_permalink()), |
|
| 402 | + esc_attr(get_the_time()), |
|
| 403 | + esc_attr(get_the_date('c')), |
|
| 404 | + esc_html(get_the_date()) |
|
| 405 | 405 | ); |
| 406 | 406 | |
| 407 | - $author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', |
|
| 408 | - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), |
|
| 409 | - esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ), |
|
| 407 | + $author = sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', |
|
| 408 | + esc_url(get_author_posts_url(get_the_author_meta('ID'))), |
|
| 409 | + esc_attr(sprintf(__('View all posts by %s', 'twentytwelve'), get_the_author())), |
|
| 410 | 410 | get_the_author() |
| 411 | 411 | ); |
| 412 | 412 | |
| 413 | 413 | // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name. |
| 414 | - if ( $tag_list ) { |
|
| 415 | - $utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' ); |
|
| 416 | - } elseif ( $categories_list ) { |
|
| 417 | - $utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' ); |
|
| 414 | + if ($tag_list) { |
|
| 415 | + $utility_text = __('This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve'); |
|
| 416 | + } elseif ($categories_list) { |
|
| 417 | + $utility_text = __('This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve'); |
|
| 418 | 418 | } else { |
| 419 | - $utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' ); |
|
| 419 | + $utility_text = __('This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve'); |
|
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | printf( |
@@ -446,38 +446,38 @@ discard block |
||
| 446 | 446 | * @param array $classes Existing class values. |
| 447 | 447 | * @return array Filtered class values. |
| 448 | 448 | */ |
| 449 | -function twentytwelve_body_class( $classes ) { |
|
| 449 | +function twentytwelve_body_class($classes) { |
|
| 450 | 450 | $background_color = get_background_color(); |
| 451 | 451 | $background_image = get_background_image(); |
| 452 | 452 | |
| 453 | - if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) ) |
|
| 453 | + if ( ! is_active_sidebar('sidebar-1') || is_page_template('page-templates/full-width.php')) |
|
| 454 | 454 | $classes[] = 'full-width'; |
| 455 | 455 | |
| 456 | - if ( is_page_template( 'page-templates/front-page.php' ) ) { |
|
| 456 | + if (is_page_template('page-templates/front-page.php')) { |
|
| 457 | 457 | $classes[] = 'template-front-page'; |
| 458 | - if ( has_post_thumbnail() ) |
|
| 458 | + if (has_post_thumbnail()) |
|
| 459 | 459 | $classes[] = 'has-post-thumbnail'; |
| 460 | - if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) ) |
|
| 460 | + if (is_active_sidebar('sidebar-2') && is_active_sidebar('sidebar-3')) |
|
| 461 | 461 | $classes[] = 'two-sidebars'; |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | - if ( empty( $background_image ) ) { |
|
| 465 | - if ( empty( $background_color ) ) |
|
| 464 | + if (empty($background_image)) { |
|
| 465 | + if (empty($background_color)) |
|
| 466 | 466 | $classes[] = 'custom-background-empty'; |
| 467 | - elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) ) |
|
| 467 | + elseif (in_array($background_color, array('fff', 'ffffff'))) |
|
| 468 | 468 | $classes[] = 'custom-background-white'; |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | // Enable custom font class only if the font CSS is queued to load. |
| 472 | - if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) ) |
|
| 472 | + if (wp_style_is('twentytwelve-fonts', 'queue')) |
|
| 473 | 473 | $classes[] = 'custom-font-enabled'; |
| 474 | 474 | |
| 475 | - if ( ! is_multi_author() ) |
|
| 475 | + if ( ! is_multi_author()) |
|
| 476 | 476 | $classes[] = 'single-author'; |
| 477 | 477 | |
| 478 | 478 | return $classes; |
| 479 | 479 | } |
| 480 | -add_filter( 'body_class', 'twentytwelve_body_class' ); |
|
| 480 | +add_filter('body_class', 'twentytwelve_body_class'); |
|
| 481 | 481 | |
| 482 | 482 | /** |
| 483 | 483 | * Adjust content width in certain contexts. |
@@ -488,12 +488,12 @@ discard block |
||
| 488 | 488 | * @since Twenty Twelve 1.0 |
| 489 | 489 | */ |
| 490 | 490 | function twentytwelve_content_width() { |
| 491 | - if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) { |
|
| 491 | + if (is_page_template('page-templates/full-width.php') || is_attachment() || ! is_active_sidebar('sidebar-1')) { |
|
| 492 | 492 | global $content_width; |
| 493 | 493 | $content_width = 960; |
| 494 | 494 | } |
| 495 | 495 | } |
| 496 | -add_action( 'template_redirect', 'twentytwelve_content_width' ); |
|
| 496 | +add_action('template_redirect', 'twentytwelve_content_width'); |
|
| 497 | 497 | |
| 498 | 498 | /** |
| 499 | 499 | * Register postMessage support. |
@@ -504,25 +504,25 @@ discard block |
||
| 504 | 504 | * |
| 505 | 505 | * @param WP_Customize_Manager $wp_customize Customizer object. |
| 506 | 506 | */ |
| 507 | -function twentytwelve_customize_register( $wp_customize ) { |
|
| 508 | - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; |
|
| 509 | - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; |
|
| 510 | - $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; |
|
| 507 | +function twentytwelve_customize_register($wp_customize) { |
|
| 508 | + $wp_customize->get_setting('blogname')->transport = 'postMessage'; |
|
| 509 | + $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; |
|
| 510 | + $wp_customize->get_setting('header_textcolor')->transport = 'postMessage'; |
|
| 511 | 511 | |
| 512 | - if ( isset( $wp_customize->selective_refresh ) ) { |
|
| 513 | - $wp_customize->selective_refresh->add_partial( 'blogname', array( |
|
| 512 | + if (isset($wp_customize->selective_refresh)) { |
|
| 513 | + $wp_customize->selective_refresh->add_partial('blogname', array( |
|
| 514 | 514 | 'selector' => '.site-title > a', |
| 515 | 515 | 'container_inclusive' => false, |
| 516 | 516 | 'render_callback' => 'twentytwelve_customize_partial_blogname', |
| 517 | - ) ); |
|
| 518 | - $wp_customize->selective_refresh->add_partial( 'blogdescription', array( |
|
| 517 | + )); |
|
| 518 | + $wp_customize->selective_refresh->add_partial('blogdescription', array( |
|
| 519 | 519 | 'selector' => '.site-description', |
| 520 | 520 | 'container_inclusive' => false, |
| 521 | 521 | 'render_callback' => 'twentytwelve_customize_partial_blogdescription', |
| 522 | - ) ); |
|
| 522 | + )); |
|
| 523 | 523 | } |
| 524 | 524 | } |
| 525 | -add_action( 'customize_register', 'twentytwelve_customize_register' ); |
|
| 525 | +add_action('customize_register', 'twentytwelve_customize_register'); |
|
| 526 | 526 | |
| 527 | 527 | /** |
| 528 | 528 | * Render the site title for the selective refresh partial. |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | * @return void |
| 534 | 534 | */ |
| 535 | 535 | function twentytwelve_customize_partial_blogname() { |
| 536 | - bloginfo( 'name' ); |
|
| 536 | + bloginfo('name'); |
|
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | /** |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | * @return void |
| 546 | 546 | */ |
| 547 | 547 | function twentytwelve_customize_partial_blogdescription() { |
| 548 | - bloginfo( 'description' ); |
|
| 548 | + bloginfo('description'); |
|
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | /** |
@@ -556,6 +556,6 @@ discard block |
||
| 556 | 556 | * @since Twenty Twelve 1.0 |
| 557 | 557 | */ |
| 558 | 558 | function twentytwelve_customize_preview_js() { |
| 559 | - wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20141120', true ); |
|
| 559 | + wp_enqueue_script('twentytwelve-customizer', get_template_directory_uri().'/js/theme-customizer.js', array('customize-preview'), '20141120', true); |
|
| 560 | 560 | } |
| 561 | -add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' ); |
|
| 561 | +add_action('customize_preview_init', 'twentytwelve_customize_preview_js'); |
|
@@ -12,17 +12,17 @@ |
||
| 12 | 12 | <div class="aside"> |
| 13 | 13 | <h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1> |
| 14 | 14 | <div class="entry-content"> |
| 15 | - <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?> |
|
| 15 | + <?php the_content(__('Continue reading <span class="meta-nav">→</span>', 'twentytwelve')); ?> |
|
| 16 | 16 | </div><!-- .entry-content --> |
| 17 | 17 | </div><!-- .aside --> |
| 18 | 18 | |
| 19 | 19 | <footer class="entry-meta"> |
| 20 | - <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a> |
|
| 21 | - <?php if ( comments_open() ) : ?> |
|
| 20 | + <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr(sprintf(__('Permalink to %s', 'twentytwelve'), the_title_attribute('echo=0'))); ?>" rel="bookmark"><?php echo get_the_date(); ?></a> |
|
| 21 | + <?php if (comments_open()) : ?> |
|
| 22 | 22 | <div class="comments-link"> |
| 23 | - <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?> |
|
| 23 | + <?php comments_popup_link('<span class="leave-reply">'.__('Leave a reply', 'twentytwelve').'</span>', __('1 Reply', 'twentytwelve'), __('% Replies', 'twentytwelve')); ?> |
|
| 24 | 24 | </div><!-- .comments-link --> |
| 25 | 25 | <?php endif; // comments_open() ?> |
| 26 | - <?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?> |
|
| 26 | + <?php edit_post_link(__('Edit', 'twentytwelve'), '<span class="edit-link">', '</span>'); ?> |
|
| 27 | 27 | </footer><!-- .entry-meta --> |
| 28 | 28 | </article><!-- #post --> |
@@ -16,32 +16,32 @@ |
||
| 16 | 16 | <section id="primary" class="site-content"> |
| 17 | 17 | <div id="content" role="main"> |
| 18 | 18 | |
| 19 | - <?php if ( have_posts() ) : ?> |
|
| 19 | + <?php if (have_posts()) : ?> |
|
| 20 | 20 | <header class="archive-header"> |
| 21 | - <h1 class="archive-title"><?php printf( __( 'Category Archives: %s', 'twentytwelve' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1> |
|
| 21 | + <h1 class="archive-title"><?php printf(__('Category Archives: %s', 'twentytwelve'), '<span>'.single_cat_title('', false).'</span>'); ?></h1> |
|
| 22 | 22 | |
| 23 | - <?php if ( category_description() ) : // Show an optional category description ?> |
|
| 23 | + <?php if (category_description()) : // Show an optional category description ?> |
|
| 24 | 24 | <div class="archive-meta"><?php echo category_description(); ?></div> |
| 25 | 25 | <?php endif; ?> |
| 26 | 26 | </header><!-- .archive-header --> |
| 27 | 27 | |
| 28 | 28 | <?php |
| 29 | 29 | /* Start the Loop */ |
| 30 | - while ( have_posts() ) : the_post(); |
|
| 30 | + while (have_posts()) : the_post(); |
|
| 31 | 31 | |
| 32 | 32 | /* Include the post format-specific template for the content. If you want to |
| 33 | 33 | * this in a child theme then include a file called called content-___.php |
| 34 | 34 | * (where ___ is the post format) and that will be used instead. |
| 35 | 35 | */ |
| 36 | - get_template_part( 'content', get_post_format() ); |
|
| 36 | + get_template_part('content', get_post_format()); |
|
| 37 | 37 | |
| 38 | 38 | endwhile; |
| 39 | 39 | |
| 40 | - twentytwelve_content_nav( 'nav-below' ); |
|
| 40 | + twentytwelve_content_nav('nav-below'); |
|
| 41 | 41 | ?> |
| 42 | 42 | |
| 43 | 43 | <?php else : ?> |
| 44 | - <?php get_template_part( 'content', 'none' ); ?> |
|
| 44 | + <?php get_template_part('content', 'none'); ?> |
|
| 45 | 45 | <?php endif; ?> |
| 46 | 46 | |
| 47 | 47 | </div><!-- #content --> |
@@ -51,8 +51,11 @@ |
||
| 51 | 51 | |
| 52 | 52 | <?php twentythirteen_paging_nav(); ?> |
| 53 | 53 | |
| 54 | - <?php else : ?> |
|
| 55 | - <?php get_template_part( 'content', 'none' ); ?> |
|
| 54 | + <?php else { |
|
| 55 | + : ?> |
|
| 56 | + <?php get_template_part( 'content', 'none' ); |
|
| 57 | +} |
|
| 58 | +?> |
|
| 56 | 59 | <?php endif; ?> |
| 57 | 60 | |
| 58 | 61 | </div><!-- #content --> |
@@ -9,18 +9,18 @@ |
||
| 9 | 9 | ?> |
| 10 | 10 | |
| 11 | 11 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
| 12 | - <header><?php _e( 'Link', 'twentytwelve' ); ?></header> |
|
| 12 | + <header><?php _e('Link', 'twentytwelve'); ?></header> |
|
| 13 | 13 | <div class="entry-content"> |
| 14 | - <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?> |
|
| 14 | + <?php the_content(__('Continue reading <span class="meta-nav">→</span>', 'twentytwelve')); ?> |
|
| 15 | 15 | </div><!-- .entry-content --> |
| 16 | 16 | |
| 17 | 17 | <footer class="entry-meta"> |
| 18 | - <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a> |
|
| 19 | - <?php if ( comments_open() ) : ?> |
|
| 18 | + <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr(sprintf(__('Permalink to %s', 'twentytwelve'), the_title_attribute('echo=0'))); ?>" rel="bookmark"><?php echo get_the_date(); ?></a> |
|
| 19 | + <?php if (comments_open()) : ?> |
|
| 20 | 20 | <div class="comments-link"> |
| 21 | - <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?> |
|
| 21 | + <?php comments_popup_link('<span class="leave-reply">'.__('Leave a reply', 'twentytwelve').'</span>', __('1 Reply', 'twentytwelve'), __('% Replies', 'twentytwelve')); ?> |
|
| 22 | 22 | </div><!-- .comments-link --> |
| 23 | 23 | <?php endif; // comments_open() ?> |
| 24 | - <?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?> |
|
| 24 | + <?php edit_post_link(__('Edit', 'twentytwelve'), '<span class="edit-link">', '</span>'); ?> |
|
| 25 | 25 | </footer><!-- .entry-meta --> |
| 26 | 26 | </article><!-- #post --> |