@@ -1,42 +1,42 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * TwentyTen functions and definitions |
|
4 | - * |
|
5 | - * Sets up the theme and provides some helper functions. Some helper functions |
|
6 | - * are used in the theme as custom template tags. Others are attached to action and |
|
7 | - * filter hooks in WordPress to change core functionality. |
|
8 | - * |
|
9 | - * The first function, twentyten_setup(), sets up the theme by registering support |
|
10 | - * for various features in WordPress, such as post thumbnails, navigation menus, and the like. |
|
11 | - * |
|
12 | - * When using a child theme (see https://codex.wordpress.org/Theme_Development and |
|
13 | - * https://codex.wordpress.org/Child_Themes), you can override certain functions |
|
14 | - * (those wrapped in a function_exists() call) by defining them first in your child theme's |
|
15 | - * functions.php file. The child theme's functions.php file is included before the parent |
|
16 | - * theme's file, so the child theme functions would be used. |
|
17 | - * |
|
18 | - * Functions that are not pluggable (not wrapped in function_exists()) are instead attached |
|
19 | - * to a filter or action hook. The hook can be removed by using remove_action() or |
|
20 | - * remove_filter() and you can attach your own function to the hook. |
|
21 | - * |
|
22 | - * We can remove the parent theme's hook only after it is attached, which means we need to |
|
23 | - * wait until setting up the child theme: |
|
24 | - * |
|
25 | - * <code> |
|
26 | - * add_action( 'after_setup_theme', 'my_child_theme_setup' ); |
|
27 | - * function my_child_theme_setup() { |
|
28 | - * // We are providing our own filter for excerpt_length (or using the unfiltered value) |
|
29 | - * remove_filter( 'excerpt_length', 'twentyten_excerpt_length' ); |
|
30 | - * ... |
|
31 | - * } |
|
32 | - * </code> |
|
33 | - * |
|
34 | - * For more information on hooks, actions, and filters, see https://codex.wordpress.org/Plugin_API. |
|
35 | - * |
|
36 | - * @package WordPress |
|
37 | - * @subpackage Twenty_Ten |
|
38 | - * @since Twenty Ten 1.0 |
|
39 | - */ |
|
3 | + * TwentyTen functions and definitions |
|
4 | + * |
|
5 | + * Sets up the theme and provides some helper functions. Some helper functions |
|
6 | + * are used in the theme as custom template tags. Others are attached to action and |
|
7 | + * filter hooks in WordPress to change core functionality. |
|
8 | + * |
|
9 | + * The first function, twentyten_setup(), sets up the theme by registering support |
|
10 | + * for various features in WordPress, such as post thumbnails, navigation menus, and the like. |
|
11 | + * |
|
12 | + * When using a child theme (see https://codex.wordpress.org/Theme_Development and |
|
13 | + * https://codex.wordpress.org/Child_Themes), you can override certain functions |
|
14 | + * (those wrapped in a function_exists() call) by defining them first in your child theme's |
|
15 | + * functions.php file. The child theme's functions.php file is included before the parent |
|
16 | + * theme's file, so the child theme functions would be used. |
|
17 | + * |
|
18 | + * Functions that are not pluggable (not wrapped in function_exists()) are instead attached |
|
19 | + * to a filter or action hook. The hook can be removed by using remove_action() or |
|
20 | + * remove_filter() and you can attach your own function to the hook. |
|
21 | + * |
|
22 | + * We can remove the parent theme's hook only after it is attached, which means we need to |
|
23 | + * wait until setting up the child theme: |
|
24 | + * |
|
25 | + * <code> |
|
26 | + * add_action( 'after_setup_theme', 'my_child_theme_setup' ); |
|
27 | + * function my_child_theme_setup() { |
|
28 | + * // We are providing our own filter for excerpt_length (or using the unfiltered value) |
|
29 | + * remove_filter( 'excerpt_length', 'twentyten_excerpt_length' ); |
|
30 | + * ... |
|
31 | + * } |
|
32 | + * </code> |
|
33 | + * |
|
34 | + * For more information on hooks, actions, and filters, see https://codex.wordpress.org/Plugin_API. |
|
35 | + * |
|
36 | + * @package WordPress |
|
37 | + * @subpackage Twenty_Ten |
|
38 | + * @since Twenty Ten 1.0 |
|
39 | + */ |
|
40 | 40 | |
41 | 41 | /* |
42 | 42 | * Set the content width based on the theme's design and stylesheet. |
@@ -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 ) { |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Template for displaying Category Archive pages |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Ten |
|
7 | - * @since Twenty Ten 1.0 |
|
8 | - */ |
|
3 | + * Template for displaying Category Archive pages |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Ten |
|
7 | + * @since Twenty Ten 1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | get_header(); ?> |
11 | 11 |
@@ -13,19 +13,19 @@ |
||
13 | 13 | <div id="content" role="main"> |
14 | 14 | |
15 | 15 | <h1 class="page-title"><?php |
16 | - printf( __( 'Category Archives: %s', 'twentyten' ), '<span>' . single_cat_title( '', false ) . '</span>' ); |
|
16 | + printf(__('Category Archives: %s', 'twentyten'), '<span>'.single_cat_title('', false).'</span>'); |
|
17 | 17 | ?></h1> |
18 | 18 | <?php |
19 | 19 | $category_description = category_description(); |
20 | - if ( ! empty( $category_description ) ) |
|
21 | - echo '<div class="archive-meta">' . $category_description . '</div>'; |
|
20 | + if ( ! empty($category_description)) |
|
21 | + echo '<div class="archive-meta">'.$category_description.'</div>'; |
|
22 | 22 | |
23 | 23 | /* |
24 | 24 | * Run the loop for the category page to output the posts. |
25 | 25 | * If you want to overload this in a child theme then include a file |
26 | 26 | * called loop-category.php and that will be used instead. |
27 | 27 | */ |
28 | - get_template_part( 'loop', 'category' ); |
|
28 | + get_template_part('loop', 'category'); |
|
29 | 29 | ?> |
30 | 30 | |
31 | 31 | </div><!-- #content --> |
@@ -17,8 +17,9 @@ |
||
17 | 17 | ?></h1> |
18 | 18 | <?php |
19 | 19 | $category_description = category_description(); |
20 | - if ( ! empty( $category_description ) ) |
|
21 | - echo '<div class="archive-meta">' . $category_description . '</div>'; |
|
20 | + if ( ! empty( $category_description ) ) { |
|
21 | + echo '<div class="archive-meta">' . $category_description . '</div>'; |
|
22 | + } |
|
22 | 23 | |
23 | 24 | /* |
24 | 25 | * Run the loop for the category page to output the posts. |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Template for displaying all pages |
|
4 | - * |
|
5 | - * This is the template that displays all pages by default. |
|
6 | - * Please note that this is the WordPress construct of pages |
|
7 | - * and that other 'pages' on your WordPress site will use a |
|
8 | - * different template. |
|
9 | - * |
|
10 | - * @package WordPress |
|
11 | - * @subpackage Twenty_Ten |
|
12 | - * @since Twenty Ten 1.0 |
|
13 | - */ |
|
3 | + * Template for displaying all pages |
|
4 | + * |
|
5 | + * This is the template that displays all pages by default. |
|
6 | + * Please note that this is the WordPress construct of pages |
|
7 | + * and that other 'pages' on your WordPress site will use a |
|
8 | + * different template. |
|
9 | + * |
|
10 | + * @package WordPress |
|
11 | + * @subpackage Twenty_Ten |
|
12 | + * @since Twenty Ten 1.0 |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | get_header(); ?> |
16 | 16 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | * If you want to overload this in a child theme then include a file |
24 | 24 | * called loop-page.php and that will be used instead. |
25 | 25 | */ |
26 | - get_template_part( 'loop', 'page' ); |
|
26 | + get_template_part('loop', 'page'); |
|
27 | 27 | ?> |
28 | 28 | |
29 | 29 | </div><!-- #content --> |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Template for displaying Search Results pages |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Ten |
|
7 | - * @since Twenty Ten 1.0 |
|
8 | - */ |
|
3 | + * Template for displaying Search Results pages |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Ten |
|
7 | + * @since Twenty Ten 1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | get_header(); ?> |
11 | 11 |
@@ -12,21 +12,21 @@ |
||
12 | 12 | <div id="container"> |
13 | 13 | <div id="content" role="main"> |
14 | 14 | |
15 | -<?php if ( have_posts() ) : ?> |
|
16 | - <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyten' ), '<span>' . get_search_query() . '</span>' ); ?></h1> |
|
15 | +<?php if (have_posts()) : ?> |
|
16 | + <h1 class="page-title"><?php printf(__('Search Results for: %s', 'twentyten'), '<span>'.get_search_query().'</span>'); ?></h1> |
|
17 | 17 | <?php |
18 | 18 | /* |
19 | 19 | * Run the loop for the search to output the results. |
20 | 20 | * If you want to overload this in a child theme then include a file |
21 | 21 | * called loop-search.php and that will be used instead. |
22 | 22 | */ |
23 | - get_template_part( 'loop', 'search' ); |
|
23 | + get_template_part('loop', 'search'); |
|
24 | 24 | ?> |
25 | 25 | <?php else : ?> |
26 | 26 | <div id="post-0" class="post no-results not-found"> |
27 | - <h2 class="entry-title"><?php _e( 'Nothing Found', 'twentyten' ); ?></h2> |
|
27 | + <h2 class="entry-title"><?php _e('Nothing Found', 'twentyten'); ?></h2> |
|
28 | 28 | <div class="entry-content"> |
29 | - <p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyten' ); ?></p> |
|
29 | + <p><?php _e('Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyten'); ?></p> |
|
30 | 30 | <?php get_search_form(); ?> |
31 | 31 | </div><!-- .entry-content --> |
32 | 32 | </div><!-- #post-0 --> |
@@ -22,9 +22,12 @@ |
||
22 | 22 | */ |
23 | 23 | get_template_part( 'loop', 'search' ); |
24 | 24 | ?> |
25 | -<?php else : ?> |
|
25 | +<?php else { |
|
26 | + : ?> |
|
26 | 27 | <div id="post-0" class="post no-results not-found"> |
27 | - <h2 class="entry-title"><?php _e( 'Nothing Found', 'twentyten' ); ?></h2> |
|
28 | + <h2 class="entry-title"><?php _e( 'Nothing Found', 'twentyten' ); |
|
29 | +} |
|
30 | +?></h2> |
|
28 | 31 | <div class="entry-content"> |
29 | 32 | <p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyten' ); ?></p> |
30 | 33 | <?php get_search_form(); ?> |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The Footer widget areas |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Ten |
|
7 | - * @since Twenty Ten 1.0 |
|
8 | - */ |
|
3 | + * The Footer widget areas |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Ten |
|
7 | + * @since Twenty Ten 1.0 |
|
8 | + */ |
|
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <?php |
@@ -15,10 +15,10 @@ discard block |
||
15 | 15 | * |
16 | 16 | * If none of the sidebars have widgets, then let's bail early. |
17 | 17 | */ |
18 | - if ( ! is_active_sidebar( 'first-footer-widget-area' ) |
|
19 | - && ! is_active_sidebar( 'second-footer-widget-area' ) |
|
20 | - && ! is_active_sidebar( 'third-footer-widget-area' ) |
|
21 | - && ! is_active_sidebar( 'fourth-footer-widget-area' ) |
|
18 | + if ( ! is_active_sidebar('first-footer-widget-area') |
|
19 | + && ! is_active_sidebar('second-footer-widget-area') |
|
20 | + && ! is_active_sidebar('third-footer-widget-area') |
|
21 | + && ! is_active_sidebar('fourth-footer-widget-area') |
|
22 | 22 | ) |
23 | 23 | return; |
24 | 24 | // If we get this far, we have widgets. Let do this. |
@@ -26,34 +26,34 @@ discard block |
||
26 | 26 | |
27 | 27 | <div id="footer-widget-area" role="complementary"> |
28 | 28 | |
29 | -<?php if ( is_active_sidebar( 'first-footer-widget-area' ) ) : ?> |
|
29 | +<?php if (is_active_sidebar('first-footer-widget-area')) : ?> |
|
30 | 30 | <div id="first" class="widget-area"> |
31 | 31 | <ul class="xoxo"> |
32 | - <?php dynamic_sidebar( 'first-footer-widget-area' ); ?> |
|
32 | + <?php dynamic_sidebar('first-footer-widget-area'); ?> |
|
33 | 33 | </ul> |
34 | 34 | </div><!-- #first .widget-area --> |
35 | 35 | <?php endif; ?> |
36 | 36 | |
37 | -<?php if ( is_active_sidebar( 'second-footer-widget-area' ) ) : ?> |
|
37 | +<?php if (is_active_sidebar('second-footer-widget-area')) : ?> |
|
38 | 38 | <div id="second" class="widget-area"> |
39 | 39 | <ul class="xoxo"> |
40 | - <?php dynamic_sidebar( 'second-footer-widget-area' ); ?> |
|
40 | + <?php dynamic_sidebar('second-footer-widget-area'); ?> |
|
41 | 41 | </ul> |
42 | 42 | </div><!-- #second .widget-area --> |
43 | 43 | <?php endif; ?> |
44 | 44 | |
45 | -<?php if ( is_active_sidebar( 'third-footer-widget-area' ) ) : ?> |
|
45 | +<?php if (is_active_sidebar('third-footer-widget-area')) : ?> |
|
46 | 46 | <div id="third" class="widget-area"> |
47 | 47 | <ul class="xoxo"> |
48 | - <?php dynamic_sidebar( 'third-footer-widget-area' ); ?> |
|
48 | + <?php dynamic_sidebar('third-footer-widget-area'); ?> |
|
49 | 49 | </ul> |
50 | 50 | </div><!-- #third .widget-area --> |
51 | 51 | <?php endif; ?> |
52 | 52 | |
53 | -<?php if ( is_active_sidebar( 'fourth-footer-widget-area' ) ) : ?> |
|
53 | +<?php if (is_active_sidebar('fourth-footer-widget-area')) : ?> |
|
54 | 54 | <div id="fourth" class="widget-area"> |
55 | 55 | <ul class="xoxo"> |
56 | - <?php dynamic_sidebar( 'fourth-footer-widget-area' ); ?> |
|
56 | + <?php dynamic_sidebar('fourth-footer-widget-area'); ?> |
|
57 | 57 | </ul> |
58 | 58 | </div><!-- #fourth .widget-area --> |
59 | 59 | <?php endif; ?> |
@@ -19,8 +19,9 @@ |
||
19 | 19 | && ! is_active_sidebar( 'second-footer-widget-area' ) |
20 | 20 | && ! is_active_sidebar( 'third-footer-widget-area' ) |
21 | 21 | && ! is_active_sidebar( 'fourth-footer-widget-area' ) |
22 | - ) |
|
23 | - return; |
|
22 | + ) { |
|
23 | + return; |
|
24 | + } |
|
24 | 25 | // If we get this far, we have widgets. Let do this. |
25 | 26 | ?> |
26 | 27 |
@@ -1,18 +1,18 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The loop that displays a single post |
|
4 | - * |
|
5 | - * The loop displays the posts and the post content. See |
|
6 | - * https://codex.wordpress.org/The_Loop to understand it and |
|
7 | - * https://codex.wordpress.org/Template_Tags to understand |
|
8 | - * the tags used in it. |
|
9 | - * |
|
10 | - * This can be overridden in child themes with loop-single.php. |
|
11 | - * |
|
12 | - * @package WordPress |
|
13 | - * @subpackage Twenty_Ten |
|
14 | - * @since Twenty Ten 1.2 |
|
15 | - */ |
|
3 | + * The loop that displays a single post |
|
4 | + * |
|
5 | + * The loop displays the posts and the post content. See |
|
6 | + * https://codex.wordpress.org/The_Loop to understand it and |
|
7 | + * https://codex.wordpress.org/Template_Tags to understand |
|
8 | + * the tags used in it. |
|
9 | + * |
|
10 | + * This can be overridden in child themes with loop-single.php. |
|
11 | + * |
|
12 | + * @package WordPress |
|
13 | + * @subpackage Twenty_Ten |
|
14 | + * @since Twenty Ten 1.2 |
|
15 | + */ |
|
16 | 16 | ?> |
17 | 17 | |
18 | 18 | <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> |
@@ -15,11 +15,11 @@ 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 | 20 | <div id="nav-above" class="navigation"> |
21 | - <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div> |
|
22 | - <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div> |
|
21 | + <div class="nav-previous"><?php previous_post_link('%link', '<span class="meta-nav">'._x('←', 'Previous post link', 'twentyten').'</span> %title'); ?></div> |
|
22 | + <div class="nav-next"><?php next_post_link('%link', '%title <span class="meta-nav">'._x('→', 'Next post link', 'twentyten').'</span>'); ?></div> |
|
23 | 23 | </div><!-- #nav-above --> |
24 | 24 | |
25 | 25 | <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
@@ -31,23 +31,23 @@ discard block |
||
31 | 31 | |
32 | 32 | <div class="entry-content"> |
33 | 33 | <?php the_content(); ?> |
34 | - <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> |
|
34 | + <?php wp_link_pages(array('before' => '<div class="page-link">'.__('Pages:', 'twentyten'), 'after' => '</div>')); ?> |
|
35 | 35 | </div><!-- .entry-content --> |
36 | 36 | |
37 | -<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?> |
|
37 | +<?php if (get_the_author_meta('description')) : // If a user has filled out their description, show a bio on their entries ?> |
|
38 | 38 | <div id="entry-author-info"> |
39 | 39 | <div id="author-avatar"> |
40 | 40 | <?php |
41 | 41 | /** This filter is documented in author.php */ |
42 | - echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); |
|
42 | + echo get_avatar(get_the_author_meta('user_email'), apply_filters('twentyten_author_bio_avatar_size', 60)); |
|
43 | 43 | ?> |
44 | 44 | </div><!-- #author-avatar --> |
45 | 45 | <div id="author-description"> |
46 | - <h2><?php printf( __( 'About %s', 'twentyten' ), get_the_author() ); ?></h2> |
|
47 | - <?php the_author_meta( 'description' ); ?> |
|
46 | + <h2><?php printf(__('About %s', 'twentyten'), get_the_author()); ?></h2> |
|
47 | + <?php the_author_meta('description'); ?> |
|
48 | 48 | <div id="author-link"> |
49 | - <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author"> |
|
50 | - <?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyten' ), get_the_author() ); ?> |
|
49 | + <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>" rel="author"> |
|
50 | + <?php printf(__('View all posts by %s <span class="meta-nav">→</span>', 'twentyten'), get_the_author()); ?> |
|
51 | 51 | </a> |
52 | 52 | </div><!-- #author-link --> |
53 | 53 | </div><!-- #author-description --> |
@@ -56,15 +56,15 @@ discard block |
||
56 | 56 | |
57 | 57 | <div class="entry-utility"> |
58 | 58 | <?php twentyten_posted_in(); ?> |
59 | - <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?> |
|
59 | + <?php edit_post_link(__('Edit', 'twentyten'), '<span class="edit-link">', '</span>'); ?> |
|
60 | 60 | </div><!-- .entry-utility --> |
61 | 61 | </div><!-- #post-## --> |
62 | 62 | |
63 | 63 | <div id="nav-below" class="navigation"> |
64 | - <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div> |
|
65 | - <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div> |
|
64 | + <div class="nav-previous"><?php previous_post_link('%link', '<span class="meta-nav">'._x('←', 'Previous post link', 'twentyten').'</span> %title'); ?></div> |
|
65 | + <div class="nav-next"><?php next_post_link('%link', '%title <span class="meta-nav">'._x('→', 'Next post link', 'twentyten').'</span>'); ?></div> |
|
66 | 66 | </div><!-- #nav-below --> |
67 | 67 | |
68 | - <?php comments_template( '', true ); ?> |
|
68 | + <?php comments_template('', true); ?> |
|
69 | 69 | |
70 | 70 | <?php endwhile; // end of the loop. ?> |
@@ -15,7 +15,10 @@ |
||
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 | <div id="nav-above" class="navigation"> |
21 | 24 | <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div> |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Template for displaying Tag Archive pages |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Ten |
|
7 | - * @since Twenty Ten 1.0 |
|
8 | - */ |
|
3 | + * Template for displaying Tag Archive pages |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Ten |
|
7 | + * @since Twenty Ten 1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | get_header(); ?> |
11 | 11 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | <div id="content" role="main"> |
14 | 14 | |
15 | 15 | <h1 class="page-title"><?php |
16 | - printf( __( 'Tag Archives: %s', 'twentyten' ), '<span>' . single_tag_title( '', false ) . '</span>' ); |
|
16 | + printf(__('Tag Archives: %s', 'twentyten'), '<span>'.single_tag_title('', false).'</span>'); |
|
17 | 17 | ?></h1> |
18 | 18 | |
19 | 19 | <?php |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * If you want to overload this in a child theme then include a file |
23 | 23 | * called loop-tag.php and that will be used instead. |
24 | 24 | */ |
25 | -get_template_part( 'loop', 'tag' ); |
|
25 | +get_template_part('loop', 'tag'); |
|
26 | 26 | ?> |
27 | 27 | </div><!-- #content --> |
28 | 28 | </div><!-- #container --> |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Template for displaying Archive pages |
|
4 | - * |
|
5 | - * Used to display archive-type pages if nothing more specific matches a query. |
|
6 | - * For example, puts together date-based pages if no date.php file exists. |
|
7 | - * |
|
8 | - * @link https://codex.wordpress.org/Template_Hierarchy |
|
9 | - * |
|
10 | - * @package WordPress |
|
11 | - * @subpackage Twenty_Ten |
|
12 | - * @since Twenty Ten 1.0 |
|
13 | - */ |
|
3 | + * Template for displaying Archive pages |
|
4 | + * |
|
5 | + * Used to display archive-type pages if nothing more specific matches a query. |
|
6 | + * For example, puts together date-based pages if no date.php file exists. |
|
7 | + * |
|
8 | + * @link https://codex.wordpress.org/Template_Hierarchy |
|
9 | + * |
|
10 | + * @package WordPress |
|
11 | + * @subpackage Twenty_Ten |
|
12 | + * @since Twenty Ten 1.0 |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | get_header(); ?> |
16 | 16 |
@@ -25,19 +25,19 @@ discard block |
||
25 | 25 | * We reset this later so we can run the loop |
26 | 26 | * properly with a call to rewind_posts(). |
27 | 27 | */ |
28 | - if ( have_posts() ) |
|
28 | + if (have_posts()) |
|
29 | 29 | the_post(); |
30 | 30 | ?> |
31 | 31 | |
32 | 32 | <h1 class="page-title"> |
33 | -<?php if ( is_day() ) : ?> |
|
34 | - <?php printf( __( 'Daily Archives: <span>%s</span>', 'twentyten' ), get_the_date() ); ?> |
|
35 | -<?php elseif ( is_month() ) : ?> |
|
36 | - <?php printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyten' ) ) ); ?> |
|
37 | -<?php elseif ( is_year() ) : ?> |
|
38 | - <?php printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentyten' ) ) ); ?> |
|
33 | +<?php if (is_day()) : ?> |
|
34 | + <?php printf(__('Daily Archives: <span>%s</span>', 'twentyten'), get_the_date()); ?> |
|
35 | +<?php elseif (is_month()) : ?> |
|
36 | + <?php printf(__('Monthly Archives: <span>%s</span>', 'twentyten'), get_the_date(_x('F Y', 'monthly archives date format', 'twentyten'))); ?> |
|
37 | +<?php elseif (is_year()) : ?> |
|
38 | + <?php printf(__('Yearly Archives: <span>%s</span>', 'twentyten'), get_the_date(_x('Y', 'yearly archives date format', 'twentyten'))); ?> |
|
39 | 39 | <?php else : ?> |
40 | - <?php _e( 'Blog Archives', 'twentyten' ); ?> |
|
40 | + <?php _e('Blog Archives', 'twentyten'); ?> |
|
41 | 41 | <?php endif; ?> |
42 | 42 | </h1> |
43 | 43 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * If you want to overload this in a child theme then include a file |
55 | 55 | * called loop-archive.php and that will be used instead. |
56 | 56 | */ |
57 | - get_template_part( 'loop', 'archive' ); |
|
57 | + get_template_part('loop', 'archive'); |
|
58 | 58 | ?> |
59 | 59 | |
60 | 60 | </div><!-- #content --> |
@@ -25,9 +25,10 @@ discard block |
||
25 | 25 | * We reset this later so we can run the loop |
26 | 26 | * properly with a call to rewind_posts(). |
27 | 27 | */ |
28 | - if ( have_posts() ) |
|
29 | - the_post(); |
|
30 | -?> |
|
28 | + if ( have_posts() ) { |
|
29 | + the_post(); |
|
30 | + } |
|
31 | + ?> |
|
31 | 32 | |
32 | 33 | <h1 class="page-title"> |
33 | 34 | <?php if ( is_day() ) : ?> |
@@ -36,8 +37,11 @@ discard block |
||
36 | 37 | <?php printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyten' ) ) ); ?> |
37 | 38 | <?php elseif ( is_year() ) : ?> |
38 | 39 | <?php printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentyten' ) ) ); ?> |
39 | -<?php else : ?> |
|
40 | - <?php _e( 'Blog Archives', 'twentyten' ); ?> |
|
40 | +<?php else { |
|
41 | + : ?> |
|
42 | + <?php _e( 'Blog Archives', 'twentyten' ); |
|
43 | +} |
|
44 | +?> |
|
41 | 45 | <?php endif; ?> |
42 | 46 | </h1> |
43 | 47 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Template for displaying attachments |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Ten |
|
7 | - * @since Twenty Ten 1.0 |
|
8 | - */ |
|
3 | + * Template for displaying attachments |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Ten |
|
7 | + * @since Twenty Ten 1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | get_header(); ?> |
11 | 11 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * If you want to overload this in a child theme then include a file |
19 | 19 | * called loop-attachment.php and that will be used instead. |
20 | 20 | */ |
21 | - get_template_part( 'loop', 'attachment' ); |
|
21 | + get_template_part('loop', 'attachment'); |
|
22 | 22 | ?> |
23 | 23 | |
24 | 24 | </div><!-- #content --> |