@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template for displaying posts in the Gallery post format |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Fourteen |
|
7 | - * @since Twenty Fourteen 1.0 |
|
8 | - */ |
|
3 | + * The template for displaying posts in the Gallery post format |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Fourteen |
|
7 | + * @since Twenty Fourteen 1.0 |
|
8 | + */ |
|
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
@@ -12,51 +12,51 @@ |
||
12 | 12 | <?php twentyfourteen_post_thumbnail(); ?> |
13 | 13 | |
14 | 14 | <header class="entry-header"> |
15 | - <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?> |
|
15 | + <?php if (in_array('category', get_object_taxonomies(get_post_type())) && twentyfourteen_categorized_blog()) : ?> |
|
16 | 16 | <div class="entry-meta"> |
17 | - <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> |
|
17 | + <span class="cat-links"><?php echo get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen')); ?></span> |
|
18 | 18 | </div><!-- .entry-meta --> |
19 | 19 | <?php |
20 | 20 | endif; |
21 | 21 | |
22 | - if ( is_single() ) : |
|
23 | - the_title( '<h1 class="entry-title">', '</h1>' ); |
|
22 | + if (is_single()) : |
|
23 | + the_title('<h1 class="entry-title">', '</h1>'); |
|
24 | 24 | else : |
25 | - the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); |
|
25 | + the_title('<h1 class="entry-title"><a href="'.esc_url(get_permalink()).'" rel="bookmark">', '</a></h1>'); |
|
26 | 26 | endif; |
27 | 27 | ?> |
28 | 28 | |
29 | 29 | <div class="entry-meta"> |
30 | 30 | <span class="post-format"> |
31 | - <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'gallery' ) ); ?>"><?php echo get_post_format_string( 'gallery' ); ?></a> |
|
31 | + <a class="entry-format" href="<?php echo esc_url(get_post_format_link('gallery')); ?>"><?php echo get_post_format_string('gallery'); ?></a> |
|
32 | 32 | </span> |
33 | 33 | |
34 | 34 | <?php twentyfourteen_posted_on(); ?> |
35 | 35 | |
36 | - <?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : ?> |
|
37 | - <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span> |
|
36 | + <?php if ( ! post_password_required() && (comments_open() || get_comments_number())) : ?> |
|
37 | + <span class="comments-link"><?php comments_popup_link(__('Leave a comment', 'twentyfourteen'), __('1 Comment', 'twentyfourteen'), __('% Comments', 'twentyfourteen')); ?></span> |
|
38 | 38 | <?php endif; ?> |
39 | 39 | |
40 | - <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?> |
|
40 | + <?php edit_post_link(__('Edit', 'twentyfourteen'), '<span class="edit-link">', '</span>'); ?> |
|
41 | 41 | </div><!-- .entry-meta --> |
42 | 42 | </header><!-- .entry-header --> |
43 | 43 | |
44 | 44 | <div class="entry-content"> |
45 | 45 | <?php |
46 | 46 | /* translators: %s: Name of current post */ |
47 | - the_content( sprintf( |
|
48 | - __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), |
|
49 | - the_title( '<span class="screen-reader-text">', '</span>', false ) |
|
50 | - ) ); |
|
47 | + the_content(sprintf( |
|
48 | + __('Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen'), |
|
49 | + the_title('<span class="screen-reader-text">', '</span>', false) |
|
50 | + )); |
|
51 | 51 | |
52 | - wp_link_pages( array( |
|
53 | - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', |
|
52 | + wp_link_pages(array( |
|
53 | + 'before' => '<div class="page-links"><span class="page-links-title">'.__('Pages:', 'twentyfourteen').'</span>', |
|
54 | 54 | 'after' => '</div>', |
55 | 55 | 'link_before' => '<span>', |
56 | 56 | 'link_after' => '</span>', |
57 | - ) ); |
|
57 | + )); |
|
58 | 58 | ?> |
59 | 59 | </div><!-- .entry-content --> |
60 | 60 | |
61 | - <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> |
|
61 | + <?php the_tags('<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>'); ?> |
|
62 | 62 | </article><!-- #post-## --> |
@@ -21,8 +21,10 @@ |
||
21 | 21 | |
22 | 22 | if ( is_single() ) : |
23 | 23 | the_title( '<h1 class="entry-title">', '</h1>' ); |
24 | - else : |
|
24 | + else { |
|
25 | + : |
|
25 | 26 | the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); |
27 | + } |
|
26 | 28 | endif; |
27 | 29 | ?> |
28 | 30 |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The Header for our theme |
|
4 | - * |
|
5 | - * Displays all of the <head> section and everything up till <div id="main"> |
|
6 | - * |
|
7 | - * @package WordPress |
|
8 | - * @subpackage Twenty_Fourteen |
|
9 | - * @since Twenty Fourteen 1.0 |
|
10 | - */ |
|
3 | + * The Header for our theme |
|
4 | + * |
|
5 | + * Displays all of the <head> section and everything up till <div id="main"> |
|
6 | + * |
|
7 | + * @package WordPress |
|
8 | + * @subpackage Twenty_Fourteen |
|
9 | + * @since Twenty Fourteen 1.0 |
|
10 | + */ |
|
11 | 11 | ?><!DOCTYPE html> |
12 | 12 | <!--[if IE 7]> |
13 | 13 | <html class="ie ie7" <?php language_attributes(); ?>> |
@@ -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 | <!--[if lt IE 9]> |
28 | 28 | <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script> |
29 | 29 | <![endif]--> |
@@ -32,26 +32,26 @@ discard block |
||
32 | 32 | |
33 | 33 | <body <?php body_class(); ?>> |
34 | 34 | <div id="page" class="hfeed site"> |
35 | - <?php if ( get_header_image() ) : ?> |
|
35 | + <?php if (get_header_image()) : ?> |
|
36 | 36 | <div id="site-header"> |
37 | - <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"> |
|
38 | - <img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"> |
|
37 | + <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"> |
|
38 | + <img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>"> |
|
39 | 39 | </a> |
40 | 40 | </div> |
41 | 41 | <?php endif; ?> |
42 | 42 | |
43 | 43 | <header id="masthead" class="site-header" role="banner"> |
44 | 44 | <div class="header-main"> |
45 | - <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> |
|
45 | + <h1 class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></h1> |
|
46 | 46 | |
47 | 47 | <div class="search-toggle"> |
48 | - <a href="#search-container" class="screen-reader-text" aria-expanded="false" aria-controls="search-container"><?php _e( 'Search', 'twentyfourteen' ); ?></a> |
|
48 | + <a href="#search-container" class="screen-reader-text" aria-expanded="false" aria-controls="search-container"><?php _e('Search', 'twentyfourteen'); ?></a> |
|
49 | 49 | </div> |
50 | 50 | |
51 | 51 | <nav id="primary-navigation" class="site-navigation primary-navigation" role="navigation"> |
52 | - <button class="menu-toggle"><?php _e( 'Primary Menu', 'twentyfourteen' ); ?></button> |
|
53 | - <a class="screen-reader-text skip-link" href="#content"><?php _e( 'Skip to content', 'twentyfourteen' ); ?></a> |
|
54 | - <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu', 'menu_id' => 'primary-menu' ) ); ?> |
|
52 | + <button class="menu-toggle"><?php _e('Primary Menu', 'twentyfourteen'); ?></button> |
|
53 | + <a class="screen-reader-text skip-link" href="#content"><?php _e('Skip to content', 'twentyfourteen'); ?></a> |
|
54 | + <?php wp_nav_menu(array('theme_location' => 'primary', 'menu_class' => 'nav-menu', 'menu_id' => 'primary-menu')); ?> |
|
55 | 55 | </nav> |
56 | 56 | </div> |
57 | 57 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The Content Sidebar |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Fourteen |
|
7 | - * @since Twenty Fourteen 1.0 |
|
8 | - */ |
|
3 | + * The Content Sidebar |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Fourteen |
|
7 | + * @since Twenty Fourteen 1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | if ( ! is_active_sidebar( 'sidebar-2' ) ) { |
11 | 11 | return; |
@@ -7,10 +7,10 @@ |
||
7 | 7 | * @since Twenty Fourteen 1.0 |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! is_active_sidebar( 'sidebar-2' ) ) { |
|
10 | +if ( ! is_active_sidebar('sidebar-2')) { |
|
11 | 11 | return; |
12 | 12 | } |
13 | 13 | ?> |
14 | 14 | <div id="content-sidebar" class="content-sidebar widget-area" role="complementary"> |
15 | - <?php dynamic_sidebar( 'sidebar-2' ); ?> |
|
15 | + <?php dynamic_sidebar('sidebar-2'); ?> |
|
16 | 16 | </div><!-- #content-sidebar --> |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Template Name: Full Width Page |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Fourteen |
|
7 | - * @since Twenty Fourteen 1.0 |
|
8 | - */ |
|
3 | + * Template Name: Full Width Page |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Fourteen |
|
7 | + * @since Twenty Fourteen 1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | get_header(); ?> |
11 | 11 |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | <div id="main-content" class="main-content"> |
13 | 13 | |
14 | 14 | <?php |
15 | - if ( is_front_page() && twentyfourteen_has_featured_posts() ) { |
|
15 | + if (is_front_page() && twentyfourteen_has_featured_posts()) { |
|
16 | 16 | // Include the featured content template. |
17 | - get_template_part( 'featured-content' ); |
|
17 | + get_template_part('featured-content'); |
|
18 | 18 | } |
19 | 19 | ?> |
20 | 20 | |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | <div id="content" class="site-content" role="main"> |
23 | 23 | <?php |
24 | 24 | // Start the Loop. |
25 | - while ( have_posts() ) : the_post(); |
|
25 | + while (have_posts()) : the_post(); |
|
26 | 26 | |
27 | 27 | // Include the page content template. |
28 | - get_template_part( 'content', 'page' ); |
|
28 | + get_template_part('content', 'page'); |
|
29 | 29 | |
30 | 30 | // If comments are open or we have at least one comment, load up the comment template. |
31 | - if ( comments_open() || get_comments_number() ) { |
|
31 | + if (comments_open() || get_comments_number()) { |
|
32 | 32 | comments_template(); |
33 | 33 | } |
34 | 34 | endwhile; |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Template Name: Contributor Page |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Fourteen |
|
7 | - * @since Twenty Fourteen 1.0 |
|
8 | - */ |
|
3 | + * Template Name: Contributor Page |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Fourteen |
|
7 | + * @since Twenty Fourteen 1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | get_header(); ?> |
11 | 11 |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | <div id="main-content" class="main-content"> |
13 | 13 | |
14 | 14 | <?php |
15 | - if ( is_front_page() && twentyfourteen_has_featured_posts() ) { |
|
15 | + if (is_front_page() && twentyfourteen_has_featured_posts()) { |
|
16 | 16 | // Include the featured content template. |
17 | - get_template_part( 'featured-content' ); |
|
17 | + get_template_part('featured-content'); |
|
18 | 18 | } |
19 | 19 | ?> |
20 | 20 | |
@@ -22,23 +22,23 @@ discard block |
||
22 | 22 | <div id="content" class="site-content" role="main"> |
23 | 23 | <?php |
24 | 24 | // Start the Loop. |
25 | - while ( have_posts() ) : the_post(); |
|
25 | + while (have_posts()) : the_post(); |
|
26 | 26 | ?> |
27 | 27 | |
28 | 28 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
29 | 29 | <?php |
30 | - the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' ); |
|
30 | + the_title('<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->'); |
|
31 | 31 | |
32 | 32 | // Output the authors list. |
33 | 33 | twentyfourteen_list_authors(); |
34 | 34 | |
35 | - edit_post_link( __( 'Edit', 'twentyfourteen' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); |
|
35 | + edit_post_link(__('Edit', 'twentyfourteen'), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>'); |
|
36 | 36 | ?> |
37 | 37 | </article><!-- #post-## --> |
38 | 38 | |
39 | 39 | <?php |
40 | 40 | // If comments are open or we have at least one comment, load up the comment template. |
41 | - if ( comments_open() || get_comments_number() ) { |
|
41 | + if (comments_open() || get_comments_number()) { |
|
42 | 42 | comments_template(); |
43 | 43 | } |
44 | 44 | endwhile; |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The Sidebar containing the main widget area |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Fourteen |
|
7 | - * @since Twenty Fourteen 1.0 |
|
8 | - */ |
|
3 | + * The Sidebar containing the main widget area |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Fourteen |
|
7 | + * @since Twenty Fourteen 1.0 |
|
8 | + */ |
|
9 | 9 | ?> |
10 | 10 | <div id="secondary"> |
11 | 11 | <?php |
@@ -9,21 +9,21 @@ |
||
9 | 9 | ?> |
10 | 10 | <div id="secondary"> |
11 | 11 | <?php |
12 | - $description = get_bloginfo( 'description', 'display' ); |
|
13 | - if ( ! empty ( $description ) ) : |
|
12 | + $description = get_bloginfo('description', 'display'); |
|
13 | + if ( ! empty ($description)) : |
|
14 | 14 | ?> |
15 | - <h2 class="site-description"><?php echo esc_html( $description ); ?></h2> |
|
15 | + <h2 class="site-description"><?php echo esc_html($description); ?></h2> |
|
16 | 16 | <?php endif; ?> |
17 | 17 | |
18 | - <?php if ( has_nav_menu( 'secondary' ) ) : ?> |
|
18 | + <?php if (has_nav_menu('secondary')) : ?> |
|
19 | 19 | <nav role="navigation" class="navigation site-navigation secondary-navigation"> |
20 | - <?php wp_nav_menu( array( 'theme_location' => 'secondary' ) ); ?> |
|
20 | + <?php wp_nav_menu(array('theme_location' => 'secondary')); ?> |
|
21 | 21 | </nav> |
22 | 22 | <?php endif; ?> |
23 | 23 | |
24 | - <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?> |
|
24 | + <?php if (is_active_sidebar('sidebar-1')) : ?> |
|
25 | 25 | <div id="primary-sidebar" class="primary-sidebar widget-area" role="complementary"> |
26 | - <?php dynamic_sidebar( 'sidebar-1' ); ?> |
|
26 | + <?php dynamic_sidebar('sidebar-1'); ?> |
|
27 | 27 | </div><!-- #primary-sidebar --> |
28 | 28 | <?php endif; ?> |
29 | 29 | </div><!-- #secondary --> |
@@ -1,18 +1,18 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The main template file |
|
4 | - * |
|
5 | - * This is the most generic template file in a WordPress theme and one |
|
6 | - * of the two required files for a theme (the other being style.css). |
|
7 | - * It is used to display a page when nothing more specific matches a query, |
|
8 | - * e.g., it puts together the home page when no home.php file exists. |
|
9 | - * |
|
10 | - * @link https://codex.wordpress.org/Template_Hierarchy |
|
11 | - * |
|
12 | - * @package WordPress |
|
13 | - * @subpackage Twenty_Fourteen |
|
14 | - * @since Twenty Fourteen 1.0 |
|
15 | - */ |
|
3 | + * The main template file |
|
4 | + * |
|
5 | + * This is the most generic template file in a WordPress theme and one |
|
6 | + * of the two required files for a theme (the other being style.css). |
|
7 | + * It is used to display a page when nothing more specific matches a query, |
|
8 | + * e.g., it puts together the home page when no home.php file exists. |
|
9 | + * |
|
10 | + * @link https://codex.wordpress.org/Template_Hierarchy |
|
11 | + * |
|
12 | + * @package WordPress |
|
13 | + * @subpackage Twenty_Fourteen |
|
14 | + * @since Twenty Fourteen 1.0 |
|
15 | + */ |
|
16 | 16 | |
17 | 17 | get_header(); ?> |
18 | 18 |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | <div id="main-content" class="main-content"> |
20 | 20 | |
21 | 21 | <?php |
22 | - if ( is_front_page() && twentyfourteen_has_featured_posts() ) { |
|
22 | + if (is_front_page() && twentyfourteen_has_featured_posts()) { |
|
23 | 23 | // Include the featured content template. |
24 | - get_template_part( 'featured-content' ); |
|
24 | + get_template_part('featured-content'); |
|
25 | 25 | } |
26 | 26 | ?> |
27 | 27 | |
@@ -29,16 +29,16 @@ discard block |
||
29 | 29 | <div id="content" class="site-content" role="main"> |
30 | 30 | |
31 | 31 | <?php |
32 | - if ( have_posts() ) : |
|
32 | + if (have_posts()) : |
|
33 | 33 | // Start the Loop. |
34 | - while ( have_posts() ) : the_post(); |
|
34 | + while (have_posts()) : the_post(); |
|
35 | 35 | |
36 | 36 | /* |
37 | 37 | * Include the post format-specific template for the content. If you want to |
38 | 38 | * use this in a child theme, then include a file called called content-___.php |
39 | 39 | * (where ___ is the post format) and that will be used instead. |
40 | 40 | */ |
41 | - get_template_part( 'content', get_post_format() ); |
|
41 | + get_template_part('content', get_post_format()); |
|
42 | 42 | |
43 | 43 | endwhile; |
44 | 44 | // Previous/next post navigation. |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | |
47 | 47 | else : |
48 | 48 | // If no content, include the "No posts found" template. |
49 | - get_template_part( 'content', 'none' ); |
|
49 | + get_template_part('content', 'none'); |
|
50 | 50 | |
51 | 51 | endif; |
52 | 52 | ?> |
53 | 53 | |
54 | 54 | </div><!-- #content --> |
55 | 55 | </div><!-- #primary --> |
56 | - <?php get_sidebar( 'content' ); ?> |
|
56 | + <?php get_sidebar('content'); ?> |
|
57 | 57 | </div><!-- #main-content --> |
58 | 58 | |
59 | 59 | <?php |
@@ -44,9 +44,11 @@ |
||
44 | 44 | // Previous/next post navigation. |
45 | 45 | twentyfourteen_paging_nav(); |
46 | 46 | |
47 | - else : |
|
47 | + else { |
|
48 | + : |
|
48 | 49 | // If no content, include the "No posts found" template. |
49 | 50 | get_template_part( 'content', 'none' ); |
51 | + } |
|
50 | 52 | |
51 | 53 | endif; |
52 | 54 | ?> |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template for displaying posts in the Video post format |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Fourteen |
|
7 | - * @since Twenty Fourteen 1.0 |
|
8 | - */ |
|
3 | + * The template for displaying posts in the Video post format |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Fourteen |
|
7 | + * @since Twenty Fourteen 1.0 |
|
8 | + */ |
|
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
@@ -12,51 +12,51 @@ |
||
12 | 12 | <?php twentyfourteen_post_thumbnail(); ?> |
13 | 13 | |
14 | 14 | <header class="entry-header"> |
15 | - <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?> |
|
15 | + <?php if (in_array('category', get_object_taxonomies(get_post_type())) && twentyfourteen_categorized_blog()) : ?> |
|
16 | 16 | <div class="entry-meta"> |
17 | - <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> |
|
17 | + <span class="cat-links"><?php echo get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen')); ?></span> |
|
18 | 18 | </div><!-- .entry-meta --> |
19 | 19 | <?php |
20 | 20 | endif; |
21 | 21 | |
22 | - if ( is_single() ) : |
|
23 | - the_title( '<h1 class="entry-title">', '</h1>' ); |
|
22 | + if (is_single()) : |
|
23 | + the_title('<h1 class="entry-title">', '</h1>'); |
|
24 | 24 | else : |
25 | - the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); |
|
25 | + the_title('<h1 class="entry-title"><a href="'.esc_url(get_permalink()).'" rel="bookmark">', '</a></h1>'); |
|
26 | 26 | endif; |
27 | 27 | ?> |
28 | 28 | |
29 | 29 | <div class="entry-meta"> |
30 | 30 | <span class="post-format"> |
31 | - <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'video' ) ); ?>"><?php echo get_post_format_string( 'video' ); ?></a> |
|
31 | + <a class="entry-format" href="<?php echo esc_url(get_post_format_link('video')); ?>"><?php echo get_post_format_string('video'); ?></a> |
|
32 | 32 | </span> |
33 | 33 | |
34 | 34 | <?php twentyfourteen_posted_on(); ?> |
35 | 35 | |
36 | - <?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : ?> |
|
37 | - <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span> |
|
36 | + <?php if ( ! post_password_required() && (comments_open() || get_comments_number())) : ?> |
|
37 | + <span class="comments-link"><?php comments_popup_link(__('Leave a comment', 'twentyfourteen'), __('1 Comment', 'twentyfourteen'), __('% Comments', 'twentyfourteen')); ?></span> |
|
38 | 38 | <?php endif; ?> |
39 | 39 | |
40 | - <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?> |
|
40 | + <?php edit_post_link(__('Edit', 'twentyfourteen'), '<span class="edit-link">', '</span>'); ?> |
|
41 | 41 | </div><!-- .entry-meta --> |
42 | 42 | </header><!-- .entry-header --> |
43 | 43 | |
44 | 44 | <div class="entry-content"> |
45 | 45 | <?php |
46 | 46 | /* translators: %s: Name of current post */ |
47 | - the_content( sprintf( |
|
48 | - __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), |
|
49 | - the_title( '<span class="screen-reader-text">', '</span>', false ) |
|
50 | - ) ); |
|
47 | + the_content(sprintf( |
|
48 | + __('Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen'), |
|
49 | + the_title('<span class="screen-reader-text">', '</span>', false) |
|
50 | + )); |
|
51 | 51 | |
52 | - wp_link_pages( array( |
|
53 | - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', |
|
52 | + wp_link_pages(array( |
|
53 | + 'before' => '<div class="page-links"><span class="page-links-title">'.__('Pages:', 'twentyfourteen').'</span>', |
|
54 | 54 | 'after' => '</div>', |
55 | 55 | 'link_before' => '<span>', |
56 | 56 | 'link_after' => '</span>', |
57 | - ) ); |
|
57 | + )); |
|
58 | 58 | ?> |
59 | 59 | </div><!-- .entry-content --> |
60 | 60 | |
61 | - <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> |
|
61 | + <?php the_tags('<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>'); ?> |
|
62 | 62 | </article><!-- #post-## --> |
@@ -21,8 +21,10 @@ |
||
21 | 21 | |
22 | 22 | if ( is_single() ) : |
23 | 23 | the_title( '<h1 class="entry-title">', '</h1>' ); |
24 | - else : |
|
24 | + else { |
|
25 | + : |
|
25 | 26 | the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); |
27 | + } |
|
26 | 28 | endif; |
27 | 29 | ?> |
28 | 30 |
@@ -1,29 +1,29 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Twenty Fourteen functions and definitions |
|
4 | - * |
|
5 | - * Set up the theme and provides some helper functions, which are used in the |
|
6 | - * theme as custom template tags. Others are attached to action and filter |
|
7 | - * hooks in WordPress to change core functionality. |
|
8 | - * |
|
9 | - * When using a child theme you can override certain functions (those wrapped |
|
10 | - * in a function_exists() call) by defining them first in your child theme's |
|
11 | - * functions.php file. The child theme's functions.php file is included before |
|
12 | - * the parent theme's file, so the child theme functions would be used. |
|
13 | - * |
|
14 | - * @link https://codex.wordpress.org/Theme_Development |
|
15 | - * @link https://codex.wordpress.org/Child_Themes |
|
16 | - * |
|
17 | - * Functions that are not pluggable (not wrapped in function_exists()) are |
|
18 | - * instead attached to a filter or action hook. |
|
19 | - * |
|
20 | - * For more information on hooks, actions, and filters, |
|
21 | - * @link https://codex.wordpress.org/Plugin_API |
|
22 | - * |
|
23 | - * @package WordPress |
|
24 | - * @subpackage Twenty_Fourteen |
|
25 | - * @since Twenty Fourteen 1.0 |
|
26 | - */ |
|
3 | + * Twenty Fourteen functions and definitions |
|
4 | + * |
|
5 | + * Set up the theme and provides some helper functions, which are used in the |
|
6 | + * theme as custom template tags. Others are attached to action and filter |
|
7 | + * hooks in WordPress to change core functionality. |
|
8 | + * |
|
9 | + * When using a child theme you can override certain functions (those wrapped |
|
10 | + * in a function_exists() call) by defining them first in your child theme's |
|
11 | + * functions.php file. The child theme's functions.php file is included before |
|
12 | + * the parent theme's file, so the child theme functions would be used. |
|
13 | + * |
|
14 | + * @link https://codex.wordpress.org/Theme_Development |
|
15 | + * @link https://codex.wordpress.org/Child_Themes |
|
16 | + * |
|
17 | + * Functions that are not pluggable (not wrapped in function_exists()) are |
|
18 | + * instead attached to a filter or action hook. |
|
19 | + * |
|
20 | + * For more information on hooks, actions, and filters, |
|
21 | + * @link https://codex.wordpress.org/Plugin_API |
|
22 | + * |
|
23 | + * @package WordPress |
|
24 | + * @subpackage Twenty_Fourteen |
|
25 | + * @since Twenty Fourteen 1.0 |
|
26 | + */ |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Set up the content width value based on the theme's design. |
@@ -32,18 +32,18 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @since Twenty Fourteen 1.0 |
34 | 34 | */ |
35 | -if ( ! isset( $content_width ) ) { |
|
35 | +if ( ! isset($content_width)) { |
|
36 | 36 | $content_width = 474; |
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Twenty Fourteen only works in WordPress 3.6 or later. |
41 | 41 | */ |
42 | -if ( version_compare( $GLOBALS['wp_version'], '3.6', '<' ) ) { |
|
43 | - require get_template_directory() . '/inc/back-compat.php'; |
|
42 | +if (version_compare($GLOBALS['wp_version'], '3.6', '<')) { |
|
43 | + require get_template_directory().'/inc/back-compat.php'; |
|
44 | 44 | } |
45 | 45 | |
46 | -if ( ! function_exists( 'twentyfourteen_setup' ) ) : |
|
46 | +if ( ! function_exists('twentyfourteen_setup')) : |
|
47 | 47 | /** |
48 | 48 | * Twenty Fourteen setup. |
49 | 49 | * |
@@ -65,57 +65,57 @@ discard block |
||
65 | 65 | * replace to change 'twentyfourteen' to the name of your theme in all |
66 | 66 | * template files. |
67 | 67 | */ |
68 | - load_theme_textdomain( 'twentyfourteen', get_template_directory() . '/languages' ); |
|
68 | + load_theme_textdomain('twentyfourteen', get_template_directory().'/languages'); |
|
69 | 69 | |
70 | 70 | // This theme styles the visual editor to resemble the theme style. |
71 | - add_editor_style( array( 'css/editor-style.css', twentyfourteen_font_url(), 'genericons/genericons.css' ) ); |
|
71 | + add_editor_style(array('css/editor-style.css', twentyfourteen_font_url(), 'genericons/genericons.css')); |
|
72 | 72 | |
73 | 73 | // Add RSS feed links to <head> for posts and comments. |
74 | - add_theme_support( 'automatic-feed-links' ); |
|
74 | + add_theme_support('automatic-feed-links'); |
|
75 | 75 | |
76 | 76 | // Enable support for Post Thumbnails, and declare two sizes. |
77 | - add_theme_support( 'post-thumbnails' ); |
|
78 | - set_post_thumbnail_size( 672, 372, true ); |
|
79 | - add_image_size( 'twentyfourteen-full-width', 1038, 576, true ); |
|
77 | + add_theme_support('post-thumbnails'); |
|
78 | + set_post_thumbnail_size(672, 372, true); |
|
79 | + add_image_size('twentyfourteen-full-width', 1038, 576, true); |
|
80 | 80 | |
81 | 81 | // This theme uses wp_nav_menu() in two locations. |
82 | - register_nav_menus( array( |
|
83 | - 'primary' => __( 'Top primary menu', 'twentyfourteen' ), |
|
84 | - 'secondary' => __( 'Secondary menu in left sidebar', 'twentyfourteen' ), |
|
85 | - ) ); |
|
82 | + register_nav_menus(array( |
|
83 | + 'primary' => __('Top primary menu', 'twentyfourteen'), |
|
84 | + 'secondary' => __('Secondary menu in left sidebar', 'twentyfourteen'), |
|
85 | + )); |
|
86 | 86 | |
87 | 87 | /* |
88 | 88 | * Switch default core markup for search form, comment form, and comments |
89 | 89 | * to output valid HTML5. |
90 | 90 | */ |
91 | - add_theme_support( 'html5', array( |
|
91 | + add_theme_support('html5', array( |
|
92 | 92 | 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' |
93 | - ) ); |
|
93 | + )); |
|
94 | 94 | |
95 | 95 | /* |
96 | 96 | * Enable support for Post Formats. |
97 | 97 | * See https://codex.wordpress.org/Post_Formats |
98 | 98 | */ |
99 | - add_theme_support( 'post-formats', array( |
|
99 | + add_theme_support('post-formats', array( |
|
100 | 100 | 'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery', |
101 | - ) ); |
|
101 | + )); |
|
102 | 102 | |
103 | 103 | // This theme allows users to set a custom background. |
104 | - add_theme_support( 'custom-background', apply_filters( 'twentyfourteen_custom_background_args', array( |
|
104 | + add_theme_support('custom-background', apply_filters('twentyfourteen_custom_background_args', array( |
|
105 | 105 | 'default-color' => 'f5f5f5', |
106 | - ) ) ); |
|
106 | + ))); |
|
107 | 107 | |
108 | 108 | // Add support for featured content. |
109 | - add_theme_support( 'featured-content', array( |
|
109 | + add_theme_support('featured-content', array( |
|
110 | 110 | 'featured_content_filter' => 'twentyfourteen_get_featured_posts', |
111 | 111 | 'max_posts' => 6, |
112 | - ) ); |
|
112 | + )); |
|
113 | 113 | |
114 | 114 | // This theme uses its own gallery styles. |
115 | - add_filter( 'use_default_gallery_style', '__return_false' ); |
|
115 | + add_filter('use_default_gallery_style', '__return_false'); |
|
116 | 116 | } |
117 | 117 | endif; // twentyfourteen_setup |
118 | -add_action( 'after_setup_theme', 'twentyfourteen_setup' ); |
|
118 | +add_action('after_setup_theme', 'twentyfourteen_setup'); |
|
119 | 119 | |
120 | 120 | /** |
121 | 121 | * Adjust content_width value for image attachment template. |
@@ -123,11 +123,11 @@ discard block |
||
123 | 123 | * @since Twenty Fourteen 1.0 |
124 | 124 | */ |
125 | 125 | function twentyfourteen_content_width() { |
126 | - if ( is_attachment() && wp_attachment_is_image() ) { |
|
126 | + if (is_attachment() && wp_attachment_is_image()) { |
|
127 | 127 | $GLOBALS['content_width'] = 810; |
128 | 128 | } |
129 | 129 | } |
130 | -add_action( 'template_redirect', 'twentyfourteen_content_width' ); |
|
130 | +add_action('template_redirect', 'twentyfourteen_content_width'); |
|
131 | 131 | |
132 | 132 | /** |
133 | 133 | * Getter function for Featured Content Plugin. |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * |
145 | 145 | * @param array|bool $posts Array of featured posts, otherwise false. |
146 | 146 | */ |
147 | - return apply_filters( 'twentyfourteen_get_featured_posts', array() ); |
|
147 | + return apply_filters('twentyfourteen_get_featured_posts', array()); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -164,38 +164,38 @@ discard block |
||
164 | 164 | * @since Twenty Fourteen 1.0 |
165 | 165 | */ |
166 | 166 | function twentyfourteen_widgets_init() { |
167 | - require get_template_directory() . '/inc/widgets.php'; |
|
168 | - register_widget( 'Twenty_Fourteen_Ephemera_Widget' ); |
|
167 | + require get_template_directory().'/inc/widgets.php'; |
|
168 | + register_widget('Twenty_Fourteen_Ephemera_Widget'); |
|
169 | 169 | |
170 | - register_sidebar( array( |
|
171 | - 'name' => __( 'Primary Sidebar', 'twentyfourteen' ), |
|
170 | + register_sidebar(array( |
|
171 | + 'name' => __('Primary Sidebar', 'twentyfourteen'), |
|
172 | 172 | 'id' => 'sidebar-1', |
173 | - 'description' => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ), |
|
173 | + 'description' => __('Main sidebar that appears on the left.', 'twentyfourteen'), |
|
174 | 174 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
175 | 175 | 'after_widget' => '</aside>', |
176 | 176 | 'before_title' => '<h1 class="widget-title">', |
177 | 177 | 'after_title' => '</h1>', |
178 | - ) ); |
|
179 | - register_sidebar( array( |
|
180 | - 'name' => __( 'Content Sidebar', 'twentyfourteen' ), |
|
178 | + )); |
|
179 | + register_sidebar(array( |
|
180 | + 'name' => __('Content Sidebar', 'twentyfourteen'), |
|
181 | 181 | 'id' => 'sidebar-2', |
182 | - 'description' => __( 'Additional sidebar that appears on the right.', 'twentyfourteen' ), |
|
182 | + 'description' => __('Additional sidebar that appears on the right.', 'twentyfourteen'), |
|
183 | 183 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
184 | 184 | 'after_widget' => '</aside>', |
185 | 185 | 'before_title' => '<h1 class="widget-title">', |
186 | 186 | 'after_title' => '</h1>', |
187 | - ) ); |
|
188 | - register_sidebar( array( |
|
189 | - 'name' => __( 'Footer Widget Area', 'twentyfourteen' ), |
|
187 | + )); |
|
188 | + register_sidebar(array( |
|
189 | + 'name' => __('Footer Widget Area', 'twentyfourteen'), |
|
190 | 190 | 'id' => 'sidebar-3', |
191 | - 'description' => __( 'Appears in the footer section of the site.', 'twentyfourteen' ), |
|
191 | + 'description' => __('Appears in the footer section of the site.', 'twentyfourteen'), |
|
192 | 192 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
193 | 193 | 'after_widget' => '</aside>', |
194 | 194 | 'before_title' => '<h1 class="widget-title">', |
195 | 195 | 'after_title' => '</h1>', |
196 | - ) ); |
|
196 | + )); |
|
197 | 197 | } |
198 | -add_action( 'widgets_init', 'twentyfourteen_widgets_init' ); |
|
198 | +add_action('widgets_init', 'twentyfourteen_widgets_init'); |
|
199 | 199 | |
200 | 200 | /** |
201 | 201 | * Register Lato Google font for Twenty Fourteen. |
@@ -210,12 +210,12 @@ discard block |
||
210 | 210 | * Translators: If there are characters in your language that are not supported |
211 | 211 | * by Lato, translate this to 'off'. Do not translate into your own language. |
212 | 212 | */ |
213 | - if ( 'off' !== _x( 'on', 'Lato font: on or off', 'twentyfourteen' ) ) { |
|
213 | + if ('off' !== _x('on', 'Lato font: on or off', 'twentyfourteen')) { |
|
214 | 214 | $query_args = array( |
215 | - 'family' => urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ), |
|
216 | - 'subset' => urlencode( 'latin,latin-ext' ), |
|
215 | + 'family' => urlencode('Lato:300,400,700,900,300italic,400italic,700italic'), |
|
216 | + 'subset' => urlencode('latin,latin-ext'), |
|
217 | 217 | ); |
218 | - $font_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); |
|
218 | + $font_url = add_query_arg($query_args, 'https://fonts.googleapis.com/css'); |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | return $font_url; |
@@ -228,41 +228,41 @@ discard block |
||
228 | 228 | */ |
229 | 229 | function twentyfourteen_scripts() { |
230 | 230 | // Add Lato font, used in the main stylesheet. |
231 | - wp_enqueue_style( 'twentyfourteen-lato', twentyfourteen_font_url(), array(), null ); |
|
231 | + wp_enqueue_style('twentyfourteen-lato', twentyfourteen_font_url(), array(), null); |
|
232 | 232 | |
233 | 233 | // Add Genericons font, used in the main stylesheet. |
234 | - wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.0.3' ); |
|
234 | + wp_enqueue_style('genericons', get_template_directory_uri().'/genericons/genericons.css', array(), '3.0.3'); |
|
235 | 235 | |
236 | 236 | // Load our main stylesheet. |
237 | - wp_enqueue_style( 'twentyfourteen-style', get_stylesheet_uri() ); |
|
237 | + wp_enqueue_style('twentyfourteen-style', get_stylesheet_uri()); |
|
238 | 238 | |
239 | 239 | // Load the Internet Explorer specific stylesheet. |
240 | - wp_enqueue_style( 'twentyfourteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfourteen-style' ), '20131205' ); |
|
241 | - wp_style_add_data( 'twentyfourteen-ie', 'conditional', 'lt IE 9' ); |
|
240 | + wp_enqueue_style('twentyfourteen-ie', get_template_directory_uri().'/css/ie.css', array('twentyfourteen-style'), '20131205'); |
|
241 | + wp_style_add_data('twentyfourteen-ie', 'conditional', 'lt IE 9'); |
|
242 | 242 | |
243 | - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { |
|
244 | - wp_enqueue_script( 'comment-reply' ); |
|
243 | + if (is_singular() && comments_open() && get_option('thread_comments')) { |
|
244 | + wp_enqueue_script('comment-reply'); |
|
245 | 245 | } |
246 | 246 | |
247 | - if ( is_singular() && wp_attachment_is_image() ) { |
|
248 | - wp_enqueue_script( 'twentyfourteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20130402' ); |
|
247 | + if (is_singular() && wp_attachment_is_image()) { |
|
248 | + wp_enqueue_script('twentyfourteen-keyboard-image-navigation', get_template_directory_uri().'/js/keyboard-image-navigation.js', array('jquery'), '20130402'); |
|
249 | 249 | } |
250 | 250 | |
251 | - if ( is_active_sidebar( 'sidebar-3' ) ) { |
|
252 | - wp_enqueue_script( 'jquery-masonry' ); |
|
251 | + if (is_active_sidebar('sidebar-3')) { |
|
252 | + wp_enqueue_script('jquery-masonry'); |
|
253 | 253 | } |
254 | 254 | |
255 | - if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) { |
|
256 | - wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20131205', true ); |
|
257 | - wp_localize_script( 'twentyfourteen-slider', 'featuredSliderDefaults', array( |
|
258 | - 'prevText' => __( 'Previous', 'twentyfourteen' ), |
|
259 | - 'nextText' => __( 'Next', 'twentyfourteen' ) |
|
260 | - ) ); |
|
255 | + if (is_front_page() && 'slider' == get_theme_mod('featured_content_layout')) { |
|
256 | + wp_enqueue_script('twentyfourteen-slider', get_template_directory_uri().'/js/slider.js', array('jquery'), '20131205', true); |
|
257 | + wp_localize_script('twentyfourteen-slider', 'featuredSliderDefaults', array( |
|
258 | + 'prevText' => __('Previous', 'twentyfourteen'), |
|
259 | + 'nextText' => __('Next', 'twentyfourteen') |
|
260 | + )); |
|
261 | 261 | } |
262 | 262 | |
263 | - wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150315', true ); |
|
263 | + wp_enqueue_script('twentyfourteen-script', get_template_directory_uri().'/js/functions.js', array('jquery'), '20150315', true); |
|
264 | 264 | } |
265 | -add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' ); |
|
265 | +add_action('wp_enqueue_scripts', 'twentyfourteen_scripts'); |
|
266 | 266 | |
267 | 267 | /** |
268 | 268 | * Enqueue Google fonts style to admin screen for custom header display. |
@@ -270,18 +270,18 @@ discard block |
||
270 | 270 | * @since Twenty Fourteen 1.0 |
271 | 271 | */ |
272 | 272 | function twentyfourteen_admin_fonts() { |
273 | - wp_enqueue_style( 'twentyfourteen-lato', twentyfourteen_font_url(), array(), null ); |
|
273 | + wp_enqueue_style('twentyfourteen-lato', twentyfourteen_font_url(), array(), null); |
|
274 | 274 | } |
275 | -add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfourteen_admin_fonts' ); |
|
275 | +add_action('admin_print_scripts-appearance_page_custom-header', 'twentyfourteen_admin_fonts'); |
|
276 | 276 | |
277 | -if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) : |
|
277 | +if ( ! function_exists('twentyfourteen_the_attached_image')) : |
|
278 | 278 | /** |
279 | 279 | * Print the attached image with a link to the next attached image. |
280 | 280 | * |
281 | 281 | * @since Twenty Fourteen 1.0 |
282 | 282 | */ |
283 | 283 | function twentyfourteen_the_attached_image() { |
284 | - $post = get_post(); |
|
284 | + $post = get_post(); |
|
285 | 285 | /** |
286 | 286 | * Filter the default Twenty Fourteen attachment size. |
287 | 287 | * |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * @type int $width Width of the image in pixels. Default 810. |
295 | 295 | * } |
296 | 296 | */ |
297 | - $attachment_size = apply_filters( 'twentyfourteen_attachment_size', array( 810, 810 ) ); |
|
297 | + $attachment_size = apply_filters('twentyfourteen_attachment_size', array(810, 810)); |
|
298 | 298 | $next_attachment_url = wp_get_attachment_url(); |
299 | 299 | |
300 | 300 | /* |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | * looking at the last image in a gallery), or, in a gallery of one, just the |
304 | 304 | * link to that image file. |
305 | 305 | */ |
306 | - $attachment_ids = get_posts( array( |
|
306 | + $attachment_ids = get_posts(array( |
|
307 | 307 | 'post_parent' => $post->post_parent, |
308 | 308 | 'fields' => 'ids', |
309 | 309 | 'numberposts' => -1, |
@@ -312,68 +312,68 @@ discard block |
||
312 | 312 | 'post_mime_type' => 'image', |
313 | 313 | 'order' => 'ASC', |
314 | 314 | 'orderby' => 'menu_order ID', |
315 | - ) ); |
|
315 | + )); |
|
316 | 316 | |
317 | 317 | // If there is more than 1 attachment in a gallery... |
318 | - if ( count( $attachment_ids ) > 1 ) { |
|
319 | - foreach ( $attachment_ids as $attachment_id ) { |
|
320 | - if ( $attachment_id == $post->ID ) { |
|
321 | - $next_id = current( $attachment_ids ); |
|
318 | + if (count($attachment_ids) > 1) { |
|
319 | + foreach ($attachment_ids as $attachment_id) { |
|
320 | + if ($attachment_id == $post->ID) { |
|
321 | + $next_id = current($attachment_ids); |
|
322 | 322 | break; |
323 | 323 | } |
324 | 324 | } |
325 | 325 | |
326 | 326 | // get the URL of the next image attachment... |
327 | - if ( $next_id ) { |
|
328 | - $next_attachment_url = get_attachment_link( $next_id ); |
|
327 | + if ($next_id) { |
|
328 | + $next_attachment_url = get_attachment_link($next_id); |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | // or get the URL of the first image attachment. |
332 | 332 | else { |
333 | - $next_attachment_url = get_attachment_link( reset( $attachment_ids ) ); |
|
333 | + $next_attachment_url = get_attachment_link(reset($attachment_ids)); |
|
334 | 334 | } |
335 | 335 | } |
336 | 336 | |
337 | - printf( '<a href="%1$s" rel="attachment">%2$s</a>', |
|
338 | - esc_url( $next_attachment_url ), |
|
339 | - wp_get_attachment_image( $post->ID, $attachment_size ) |
|
337 | + printf('<a href="%1$s" rel="attachment">%2$s</a>', |
|
338 | + esc_url($next_attachment_url), |
|
339 | + wp_get_attachment_image($post->ID, $attachment_size) |
|
340 | 340 | ); |
341 | 341 | } |
342 | 342 | endif; |
343 | 343 | |
344 | -if ( ! function_exists( 'twentyfourteen_list_authors' ) ) : |
|
344 | +if ( ! function_exists('twentyfourteen_list_authors')) : |
|
345 | 345 | /** |
346 | 346 | * Print a list of all site contributors who published at least one post. |
347 | 347 | * |
348 | 348 | * @since Twenty Fourteen 1.0 |
349 | 349 | */ |
350 | 350 | function twentyfourteen_list_authors() { |
351 | - $contributor_ids = get_users( array( |
|
351 | + $contributor_ids = get_users(array( |
|
352 | 352 | 'fields' => 'ID', |
353 | 353 | 'orderby' => 'post_count', |
354 | 354 | 'order' => 'DESC', |
355 | 355 | 'who' => 'authors', |
356 | - ) ); |
|
356 | + )); |
|
357 | 357 | |
358 | - foreach ( $contributor_ids as $contributor_id ) : |
|
359 | - $post_count = count_user_posts( $contributor_id ); |
|
358 | + foreach ($contributor_ids as $contributor_id) : |
|
359 | + $post_count = count_user_posts($contributor_id); |
|
360 | 360 | |
361 | 361 | // Move on if user has not published a post (yet). |
362 | - if ( ! $post_count ) { |
|
362 | + if ( ! $post_count) { |
|
363 | 363 | continue; |
364 | 364 | } |
365 | 365 | ?> |
366 | 366 | |
367 | 367 | <div class="contributor"> |
368 | 368 | <div class="contributor-info"> |
369 | - <div class="contributor-avatar"><?php echo get_avatar( $contributor_id, 132 ); ?></div> |
|
369 | + <div class="contributor-avatar"><?php echo get_avatar($contributor_id, 132); ?></div> |
|
370 | 370 | <div class="contributor-summary"> |
371 | - <h2 class="contributor-name"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2> |
|
371 | + <h2 class="contributor-name"><?php echo get_the_author_meta('display_name', $contributor_id); ?></h2> |
|
372 | 372 | <p class="contributor-bio"> |
373 | - <?php echo get_the_author_meta( 'description', $contributor_id ); ?> |
|
373 | + <?php echo get_the_author_meta('description', $contributor_id); ?> |
|
374 | 374 | </p> |
375 | - <a class="button contributor-posts-link" href="<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>"> |
|
376 | - <?php printf( _n( '%d Article', '%d Articles', $post_count, 'twentyfourteen' ), $post_count ); ?> |
|
375 | + <a class="button contributor-posts-link" href="<?php echo esc_url(get_author_posts_url($contributor_id)); ?>"> |
|
376 | + <?php printf(_n('%d Article', '%d Articles', $post_count, 'twentyfourteen'), $post_count); ?> |
|
377 | 377 | </a> |
378 | 378 | </div><!-- .contributor-summary --> |
379 | 379 | </div><!-- .contributor-info --> |
@@ -401,45 +401,45 @@ discard block |
||
401 | 401 | * @param array $classes A list of existing body class values. |
402 | 402 | * @return array The filtered body class list. |
403 | 403 | */ |
404 | -function twentyfourteen_body_classes( $classes ) { |
|
405 | - if ( is_multi_author() ) { |
|
404 | +function twentyfourteen_body_classes($classes) { |
|
405 | + if (is_multi_author()) { |
|
406 | 406 | $classes[] = 'group-blog'; |
407 | 407 | } |
408 | 408 | |
409 | - if ( get_header_image() ) { |
|
409 | + if (get_header_image()) { |
|
410 | 410 | $classes[] = 'header-image'; |
411 | - } elseif ( ! in_array( $GLOBALS['pagenow'], array( 'wp-activate.php', 'wp-signup.php' ) ) ) { |
|
411 | + } elseif ( ! in_array($GLOBALS['pagenow'], array('wp-activate.php', 'wp-signup.php'))) { |
|
412 | 412 | $classes[] = 'masthead-fixed'; |
413 | 413 | } |
414 | 414 | |
415 | - if ( is_archive() || is_search() || is_home() ) { |
|
415 | + if (is_archive() || is_search() || is_home()) { |
|
416 | 416 | $classes[] = 'list-view'; |
417 | 417 | } |
418 | 418 | |
419 | - if ( ( ! is_active_sidebar( 'sidebar-2' ) ) |
|
420 | - || is_page_template( 'page-templates/full-width.php' ) |
|
421 | - || is_page_template( 'page-templates/contributors.php' ) |
|
422 | - || is_attachment() ) { |
|
419 | + if (( ! is_active_sidebar('sidebar-2')) |
|
420 | + || is_page_template('page-templates/full-width.php') |
|
421 | + || is_page_template('page-templates/contributors.php') |
|
422 | + || is_attachment()) { |
|
423 | 423 | $classes[] = 'full-width'; |
424 | 424 | } |
425 | 425 | |
426 | - if ( is_active_sidebar( 'sidebar-3' ) ) { |
|
426 | + if (is_active_sidebar('sidebar-3')) { |
|
427 | 427 | $classes[] = 'footer-widgets'; |
428 | 428 | } |
429 | 429 | |
430 | - if ( is_singular() && ! is_front_page() ) { |
|
430 | + if (is_singular() && ! is_front_page()) { |
|
431 | 431 | $classes[] = 'singular'; |
432 | 432 | } |
433 | 433 | |
434 | - if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) { |
|
434 | + if (is_front_page() && 'slider' == get_theme_mod('featured_content_layout')) { |
|
435 | 435 | $classes[] = 'slider'; |
436 | - } elseif ( is_front_page() ) { |
|
436 | + } elseif (is_front_page()) { |
|
437 | 437 | $classes[] = 'grid'; |
438 | 438 | } |
439 | 439 | |
440 | 440 | return $classes; |
441 | 441 | } |
442 | -add_filter( 'body_class', 'twentyfourteen_body_classes' ); |
|
442 | +add_filter('body_class', 'twentyfourteen_body_classes'); |
|
443 | 443 | |
444 | 444 | /** |
445 | 445 | * Extend the default WordPress post classes. |
@@ -452,14 +452,14 @@ discard block |
||
452 | 452 | * @param array $classes A list of existing post class values. |
453 | 453 | * @return array The filtered post class list. |
454 | 454 | */ |
455 | -function twentyfourteen_post_classes( $classes ) { |
|
456 | - if ( ! post_password_required() && ! is_attachment() && has_post_thumbnail() ) { |
|
455 | +function twentyfourteen_post_classes($classes) { |
|
456 | + if ( ! post_password_required() && ! is_attachment() && has_post_thumbnail()) { |
|
457 | 457 | $classes[] = 'has-post-thumbnail'; |
458 | 458 | } |
459 | 459 | |
460 | 460 | return $classes; |
461 | 461 | } |
462 | -add_filter( 'post_class', 'twentyfourteen_post_classes' ); |
|
462 | +add_filter('post_class', 'twentyfourteen_post_classes'); |
|
463 | 463 | |
464 | 464 | /** |
465 | 465 | * Create a nicely formatted and more specific title element text for output |
@@ -474,39 +474,39 @@ discard block |
||
474 | 474 | * @param string $sep Optional separator. |
475 | 475 | * @return string The filtered title. |
476 | 476 | */ |
477 | -function twentyfourteen_wp_title( $title, $sep ) { |
|
477 | +function twentyfourteen_wp_title($title, $sep) { |
|
478 | 478 | global $paged, $page; |
479 | 479 | |
480 | - if ( is_feed() ) { |
|
480 | + if (is_feed()) { |
|
481 | 481 | return $title; |
482 | 482 | } |
483 | 483 | |
484 | 484 | // Add the site name. |
485 | - $title .= get_bloginfo( 'name', 'display' ); |
|
485 | + $title .= get_bloginfo('name', 'display'); |
|
486 | 486 | |
487 | 487 | // Add the site description for the home/front page. |
488 | - $site_description = get_bloginfo( 'description', 'display' ); |
|
489 | - if ( $site_description && ( is_home() || is_front_page() ) ) { |
|
488 | + $site_description = get_bloginfo('description', 'display'); |
|
489 | + if ($site_description && (is_home() || is_front_page())) { |
|
490 | 490 | $title = "$title $sep $site_description"; |
491 | 491 | } |
492 | 492 | |
493 | 493 | // Add a page number if necessary. |
494 | - if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { |
|
495 | - $title = "$title $sep " . sprintf( __( 'Page %s', 'twentyfourteen' ), max( $paged, $page ) ); |
|
494 | + if (($paged >= 2 || $page >= 2) && ! is_404()) { |
|
495 | + $title = "$title $sep ".sprintf(__('Page %s', 'twentyfourteen'), max($paged, $page)); |
|
496 | 496 | } |
497 | 497 | |
498 | 498 | return $title; |
499 | 499 | } |
500 | -add_filter( 'wp_title', 'twentyfourteen_wp_title', 10, 2 ); |
|
500 | +add_filter('wp_title', 'twentyfourteen_wp_title', 10, 2); |
|
501 | 501 | |
502 | 502 | // Implement Custom Header features. |
503 | -require get_template_directory() . '/inc/custom-header.php'; |
|
503 | +require get_template_directory().'/inc/custom-header.php'; |
|
504 | 504 | |
505 | 505 | // Custom template tags for this theme. |
506 | -require get_template_directory() . '/inc/template-tags.php'; |
|
506 | +require get_template_directory().'/inc/template-tags.php'; |
|
507 | 507 | |
508 | 508 | // Add Customizer functionality. |
509 | -require get_template_directory() . '/inc/customizer.php'; |
|
509 | +require get_template_directory().'/inc/customizer.php'; |
|
510 | 510 | |
511 | 511 | /* |
512 | 512 | * Add Featured Content functionality. |
@@ -514,6 +514,6 @@ discard block |
||
514 | 514 | * To overwrite in a plugin, define your own Featured_Content class on or |
515 | 515 | * before the 'setup_theme' hook. |
516 | 516 | */ |
517 | -if ( ! class_exists( 'Featured_Content' ) && 'plugins.php' !== $GLOBALS['pagenow'] ) { |
|
518 | - require get_template_directory() . '/inc/featured-content.php'; |
|
517 | +if ( ! class_exists('Featured_Content') && 'plugins.php' !== $GLOBALS['pagenow']) { |
|
518 | + require get_template_directory().'/inc/featured-content.php'; |
|
519 | 519 | } |