@@ -13,17 +13,17 @@ |
||
| 13 | 13 | * @param array $classes Classes for the body element. |
| 14 | 14 | * @return array |
| 15 | 15 | */ |
| 16 | -function lighthouse_body_classes( $classes ) { |
|
| 16 | +function lighthouse_body_classes($classes) { |
|
| 17 | 17 | // Adds a class of group-blog to blogs with more than 1 published author. |
| 18 | - if ( is_multi_author() ) { |
|
| 18 | + if (is_multi_author()) { |
|
| 19 | 19 | $classes[] = 'group-blog'; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | // Adds a class of hfeed to non-singular pages. |
| 23 | - if ( ! is_singular() ) { |
|
| 23 | + if ( ! is_singular()) { |
|
| 24 | 24 | $classes[] = 'hfeed'; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | return $classes; |
| 28 | 28 | } |
| 29 | -add_filter( 'body_class', 'lighthouse_body_classes' ); |
|
| 29 | +add_filter('body_class', 'lighthouse_body_classes'); |
|
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Custom functions that act independently of the theme templates. |
|
| 4 | - * |
|
| 5 | - * Eventually, some of the functionality here could be replaced by core features. |
|
| 6 | - * |
|
| 7 | - * @package Lighthouse |
|
| 8 | - */ |
|
| 3 | + * Custom functions that act independently of the theme templates. |
|
| 4 | + * |
|
| 5 | + * Eventually, some of the functionality here could be replaced by core features. |
|
| 6 | + * |
|
| 7 | + * @package Lighthouse |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * Adds custom classes to the array of body classes. |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Lighthouse Theme Customizer. |
|
| 4 | - * |
|
| 5 | - * @package Lighthouse |
|
| 6 | - */ |
|
| 3 | + * Lighthouse Theme Customizer. |
|
| 4 | + * |
|
| 5 | + * @package Lighthouse |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * Add postMessage support for site title and description for the Theme Customizer. |
@@ -10,17 +10,17 @@ |
||
| 10 | 10 | * |
| 11 | 11 | * @param WP_Customize_Manager $wp_customize Theme Customizer object. |
| 12 | 12 | */ |
| 13 | -function lighthouse_customize_register( $wp_customize ) { |
|
| 14 | - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; |
|
| 15 | - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; |
|
| 16 | - $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; |
|
| 13 | +function lighthouse_customize_register($wp_customize) { |
|
| 14 | + $wp_customize->get_setting('blogname')->transport = 'postMessage'; |
|
| 15 | + $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; |
|
| 16 | + $wp_customize->get_setting('header_textcolor')->transport = 'postMessage'; |
|
| 17 | 17 | } |
| 18 | -add_action( 'customize_register', 'lighthouse_customize_register' ); |
|
| 18 | +add_action('customize_register', 'lighthouse_customize_register'); |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. |
| 22 | 22 | */ |
| 23 | 23 | function lighthouse_customize_preview_js() { |
| 24 | - wp_enqueue_script( 'lighthouse_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true ); |
|
| 24 | + wp_enqueue_script('lighthouse_customizer', get_template_directory_uri().'/js/customizer.js', array('customize-preview'), '20130508', true); |
|
| 25 | 25 | } |
| 26 | -add_action( 'customize_preview_init', 'lighthouse_customize_preview_js' ); |
|
| 26 | +add_action('customize_preview_init', 'lighthouse_customize_preview_js'); |
|
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Jetpack Compatibility File. |
|
| 4 | - * |
|
| 5 | - * @link https://jetpack.me/ |
|
| 6 | - * |
|
| 7 | - * @package Lighthouse |
|
| 8 | - */ |
|
| 3 | + * Jetpack Compatibility File. |
|
| 4 | + * |
|
| 5 | + * @link https://jetpack.me/ |
|
| 6 | + * |
|
| 7 | + * @package Lighthouse |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * Jetpack setup function. |
@@ -33,9 +33,9 @@ discard block |
||
| 33 | 33 | while ( have_posts() ) { |
| 34 | 34 | the_post(); |
| 35 | 35 | if ( is_search() ) : |
| 36 | - get_template_part( 'template-parts/content', 'search' ); |
|
| 36 | + get_template_part( 'template-parts/content', 'search' ); |
|
| 37 | 37 | else : |
| 38 | - get_template_part( 'template-parts/content', get_post_format() ); |
|
| 38 | + get_template_part( 'template-parts/content', get_post_format() ); |
|
| 39 | 39 | endif; |
| 40 | 40 | } |
| 41 | 41 | } |
@@ -15,27 +15,27 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | function lighthouse_jetpack_setup() { |
| 17 | 17 | // Add theme support for Infinite Scroll. |
| 18 | - add_theme_support( 'infinite-scroll', array( |
|
| 18 | + add_theme_support('infinite-scroll', array( |
|
| 19 | 19 | 'container' => 'main', |
| 20 | 20 | 'render' => 'lighthouse_infinite_scroll_render', |
| 21 | 21 | 'footer' => 'page', |
| 22 | - ) ); |
|
| 22 | + )); |
|
| 23 | 23 | |
| 24 | 24 | // Add theme support for Responsive Videos. |
| 25 | - add_theme_support( 'jetpack-responsive-videos' ); |
|
| 25 | + add_theme_support('jetpack-responsive-videos'); |
|
| 26 | 26 | } |
| 27 | -add_action( 'after_setup_theme', 'lighthouse_jetpack_setup' ); |
|
| 27 | +add_action('after_setup_theme', 'lighthouse_jetpack_setup'); |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Custom render function for Infinite Scroll. |
| 31 | 31 | */ |
| 32 | 32 | function lighthouse_infinite_scroll_render() { |
| 33 | - while ( have_posts() ) { |
|
| 33 | + while (have_posts()) { |
|
| 34 | 34 | the_post(); |
| 35 | - if ( is_search() ) : |
|
| 36 | - get_template_part( 'template-parts/content', 'search' ); |
|
| 35 | + if (is_search()) : |
|
| 36 | + get_template_part('template-parts/content', 'search'); |
|
| 37 | 37 | else : |
| 38 | - get_template_part( 'template-parts/content', get_post_format() ); |
|
| 38 | + get_template_part('template-parts/content', get_post_format()); |
|
| 39 | 39 | endif; |
| 40 | 40 | } |
| 41 | 41 | } |
@@ -34,8 +34,10 @@ |
||
| 34 | 34 | the_post(); |
| 35 | 35 | if ( is_search() ) : |
| 36 | 36 | get_template_part( 'template-parts/content', 'search' ); |
| 37 | - else : |
|
| 37 | + else { |
|
| 38 | + : |
|
| 38 | 39 | get_template_part( 'template-parts/content', get_post_format() ); |
| 40 | + } |
|
| 39 | 41 | endif; |
| 40 | 42 | } |
| 41 | 43 | } |
@@ -21,18 +21,18 @@ discard block |
||
| 21 | 21 | * @uses lighthouse_header_style() |
| 22 | 22 | */ |
| 23 | 23 | function lighthouse_custom_header_setup() { |
| 24 | - add_theme_support( 'custom-header', apply_filters( 'lighthouse_custom_header_args', array( |
|
| 24 | + add_theme_support('custom-header', apply_filters('lighthouse_custom_header_args', array( |
|
| 25 | 25 | 'default-image' => '', |
| 26 | 26 | 'default-text-color' => '000000', |
| 27 | 27 | 'width' => 1000, |
| 28 | 28 | 'height' => 250, |
| 29 | 29 | 'flex-height' => true, |
| 30 | 30 | 'wp-head-callback' => 'lighthouse_header_style', |
| 31 | - ) ) ); |
|
| 31 | + ))); |
|
| 32 | 32 | } |
| 33 | -add_action( 'after_setup_theme', 'lighthouse_custom_header_setup' ); |
|
| 33 | +add_action('after_setup_theme', 'lighthouse_custom_header_setup'); |
|
| 34 | 34 | |
| 35 | -if ( ! function_exists( 'lighthouse_header_style' ) ) : |
|
| 35 | +if ( ! function_exists('lighthouse_header_style')) : |
|
| 36 | 36 | /** |
| 37 | 37 | * Styles the header image and text displayed on the blog. |
| 38 | 38 | * |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * If no custom options for text are set, let's bail. |
| 46 | 46 | * get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: HEADER_TEXTCOLOR. |
| 47 | 47 | */ |
| 48 | - if ( HEADER_TEXTCOLOR === $header_text_color ) { |
|
| 48 | + if (HEADER_TEXTCOLOR === $header_text_color) { |
|
| 49 | 49 | return; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | <style type="text/css"> |
| 55 | 55 | <?php |
| 56 | 56 | // Has the text been hidden? |
| 57 | - if ( ! display_header_text() ) : |
|
| 57 | + if ( ! display_header_text()) : |
|
| 58 | 58 | ?> |
| 59 | 59 | .site-title, |
| 60 | 60 | .site-description { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ?> |
| 68 | 68 | .site-title a, |
| 69 | 69 | .site-description { |
| 70 | - color: #<?php echo esc_attr( $header_text_color ); ?>; |
|
| 70 | + color: #<?php echo esc_attr($header_text_color); ?>; |
|
| 71 | 71 | } |
| 72 | 72 | <?php endif; ?> |
| 73 | 73 | </style> |
@@ -63,11 +63,14 @@ |
||
| 63 | 63 | } |
| 64 | 64 | <?php |
| 65 | 65 | // If the user has set a custom color for the text use that. |
| 66 | - else : |
|
| 66 | + else { |
|
| 67 | + : |
|
| 67 | 68 | ?> |
| 68 | 69 | .site-title a, |
| 69 | 70 | .site-description { |
| 70 | - color: #<?php echo esc_attr( $header_text_color ); ?>; |
|
| 71 | + color: #<?php echo esc_attr( $header_text_color ); |
|
| 72 | + } |
|
| 73 | + ?>; |
|
| 71 | 74 | } |
| 72 | 75 | <?php endif; ?> |
| 73 | 76 | </style> |
@@ -1,19 +1,19 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Sample implementation of the Custom Header feature. |
|
| 4 | - * |
|
| 5 | - * You can add an optional custom header image to header.php like so ... |
|
| 6 | - * |
|
| 3 | + * Sample implementation of the Custom Header feature. |
|
| 4 | + * |
|
| 5 | + * You can add an optional custom header image to header.php like so ... |
|
| 6 | + * |
|
| 7 | 7 | <?php if ( get_header_image() ) : ?> |
| 8 | 8 | <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"> |
| 9 | 9 | <img src="<?php header_image(); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt=""> |
| 10 | 10 | </a> |
| 11 | 11 | <?php endif; // End header image check. ?> |
| 12 | - * |
|
| 13 | - * @link https://developer.wordpress.org/themes/functionality/custom-headers/ |
|
| 14 | - * |
|
| 15 | - * @package Lighthouse |
|
| 16 | - */ |
|
| 12 | + * |
|
| 13 | + * @link https://developer.wordpress.org/themes/functionality/custom-headers/ |
|
| 14 | + * |
|
| 15 | + * @package Lighthouse |
|
| 16 | + */ |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Set up the WordPress core custom header feature. |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Custom template tags for this theme. |
|
| 4 | - * |
|
| 5 | - * Eventually, some of the functionality here could be replaced by core features. |
|
| 6 | - * |
|
| 7 | - * @package Lighthouse |
|
| 8 | - */ |
|
| 3 | + * Custom template tags for this theme. |
|
| 4 | + * |
|
| 5 | + * Eventually, some of the functionality here could be replaced by core features. |
|
| 6 | + * |
|
| 7 | + * @package Lighthouse |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | if ( ! function_exists( 'lighthouse_posted_on' ) ) : |
| 11 | 11 | /** |
@@ -125,16 +125,16 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | //Left menu |
| 127 | 127 | function lighthouse_header_menu_left() { |
| 128 | - if ( has_nav_menu( 'header-menu-left' ) ) { |
|
| 129 | - wp_nav_menu( |
|
| 130 | - array( |
|
| 131 | - 'theme_location' => 'header-menu-left', |
|
| 132 | - 'menu' => '', |
|
| 133 | - 'container' => 'div', |
|
| 134 | - 'container_id' => 'header-menu-left-id', |
|
| 135 | - 'container_class' => 'header-menu-left-cl', |
|
| 136 | - 'menu_id' => 'header-menu-id', |
|
| 137 | - 'menu_class' => 'header-menu-cl', |
|
| 128 | + if ( has_nav_menu( 'header-menu-left' ) ) { |
|
| 129 | + wp_nav_menu( |
|
| 130 | + array( |
|
| 131 | + 'theme_location' => 'header-menu-left', |
|
| 132 | + 'menu' => '', |
|
| 133 | + 'container' => 'div', |
|
| 134 | + 'container_id' => 'header-menu-left-id', |
|
| 135 | + 'container_class' => 'header-menu-left-cl', |
|
| 136 | + 'menu_id' => 'header-menu-id', |
|
| 137 | + 'menu_class' => 'header-menu-cl', |
|
| 138 | 138 | 'echo' => true, |
| 139 | 139 | 'fallback_cb' => '', |
| 140 | 140 | 'before' => '', |
@@ -144,23 +144,23 @@ discard block |
||
| 144 | 144 | 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', |
| 145 | 145 | 'depth' => 0, |
| 146 | 146 | 'walker' => '' |
| 147 | - ) |
|
| 148 | - ); |
|
| 149 | - } |
|
| 147 | + ) |
|
| 148 | + ); |
|
| 149 | + } |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | //Right menu |
| 153 | 153 | function lighthouse_header_menu_right() { |
| 154 | - if ( has_nav_menu( 'header-menu-right' ) ) { |
|
| 155 | - wp_nav_menu( |
|
| 156 | - array( |
|
| 157 | - 'theme_location' => 'header-menu-right', |
|
| 158 | - 'menu' => '', |
|
| 159 | - 'container' => 'div', |
|
| 160 | - 'container_id' => 'header-menu-right-id', |
|
| 161 | - 'container_class' => 'header-menu-right-cl', |
|
| 162 | - 'menu_id' => 'header-menu-id', |
|
| 163 | - 'menu_class' => 'header-menu-cl', |
|
| 154 | + if ( has_nav_menu( 'header-menu-right' ) ) { |
|
| 155 | + wp_nav_menu( |
|
| 156 | + array( |
|
| 157 | + 'theme_location' => 'header-menu-right', |
|
| 158 | + 'menu' => '', |
|
| 159 | + 'container' => 'div', |
|
| 160 | + 'container_id' => 'header-menu-right-id', |
|
| 161 | + 'container_class' => 'header-menu-right-cl', |
|
| 162 | + 'menu_id' => 'header-menu-id', |
|
| 163 | + 'menu_class' => 'header-menu-cl', |
|
| 164 | 164 | 'echo' => true, |
| 165 | 165 | 'fallback_cb' => '', |
| 166 | 166 | 'before' => '', |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', |
| 171 | 171 | 'depth' => 0, |
| 172 | 172 | 'walker' => '' |
| 173 | - ) |
|
| 174 | - ); |
|
| 175 | - } |
|
| 173 | + ) |
|
| 174 | + ); |
|
| 175 | + } |
|
| 176 | 176 | } |
| 177 | 177 | \ No newline at end of file |
@@ -7,69 +7,69 @@ discard block |
||
| 7 | 7 | * @package Lighthouse |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -if ( ! function_exists( 'lighthouse_posted_on' ) ) : |
|
| 10 | +if ( ! function_exists('lighthouse_posted_on')) : |
|
| 11 | 11 | /** |
| 12 | 12 | * Prints HTML with meta information for the current post-date/time and author. |
| 13 | 13 | */ |
| 14 | 14 | function lighthouse_posted_on() { |
| 15 | 15 | $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; |
| 16 | - if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { |
|
| 16 | + if (get_the_time('U') !== get_the_modified_time('U')) { |
|
| 17 | 17 | $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - $time_string = sprintf( $time_string, |
|
| 21 | - esc_attr( get_the_date( 'c' ) ), |
|
| 22 | - esc_html( get_the_date() ), |
|
| 23 | - esc_attr( get_the_modified_date( 'c' ) ), |
|
| 24 | - esc_html( get_the_modified_date() ) |
|
| 20 | + $time_string = sprintf($time_string, |
|
| 21 | + esc_attr(get_the_date('c')), |
|
| 22 | + esc_html(get_the_date()), |
|
| 23 | + esc_attr(get_the_modified_date('c')), |
|
| 24 | + esc_html(get_the_modified_date()) |
|
| 25 | 25 | ); |
| 26 | 26 | |
| 27 | 27 | $posted_on = sprintf( |
| 28 | - esc_html_x( 'Posted on %s', 'post date', 'lighthouse' ), |
|
| 29 | - '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' |
|
| 28 | + esc_html_x('Posted on %s', 'post date', 'lighthouse'), |
|
| 29 | + '<a href="'.esc_url(get_permalink()).'" rel="bookmark">'.$time_string.'</a>' |
|
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | 32 | $byline = sprintf( |
| 33 | - esc_html_x( 'by %s', 'post author', 'lighthouse' ), |
|
| 34 | - '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>' |
|
| 33 | + esc_html_x('by %s', 'post author', 'lighthouse'), |
|
| 34 | + '<span class="author vcard"><a class="url fn n" href="'.esc_url(get_author_posts_url(get_the_author_meta('ID'))).'">'.esc_html(get_the_author()).'</a></span>' |
|
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | - echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK. |
|
| 37 | + echo '<span class="posted-on">'.$posted_on.'</span><span class="byline"> '.$byline.'</span>'; // WPCS: XSS OK. |
|
| 38 | 38 | |
| 39 | 39 | } |
| 40 | 40 | endif; |
| 41 | 41 | |
| 42 | -if ( ! function_exists( 'lighthouse_entry_footer' ) ) : |
|
| 42 | +if ( ! function_exists('lighthouse_entry_footer')) : |
|
| 43 | 43 | /** |
| 44 | 44 | * Prints HTML with meta information for the categories, tags and comments. |
| 45 | 45 | */ |
| 46 | 46 | function lighthouse_entry_footer() { |
| 47 | 47 | // Hide category and tag text for pages. |
| 48 | - if ( 'post' === get_post_type() ) { |
|
| 48 | + if ('post' === get_post_type()) { |
|
| 49 | 49 | /* translators: used between list items, there is a space after the comma */ |
| 50 | - $categories_list = get_the_category_list( esc_html__( ', ', 'lighthouse' ) ); |
|
| 51 | - if ( $categories_list && lighthouse_categorized_blog() ) { |
|
| 52 | - printf( '<span class="cat-links">' . esc_html__( 'Posted in %1$s', 'lighthouse' ) . '</span>', $categories_list ); // WPCS: XSS OK. |
|
| 50 | + $categories_list = get_the_category_list(esc_html__(', ', 'lighthouse')); |
|
| 51 | + if ($categories_list && lighthouse_categorized_blog()) { |
|
| 52 | + printf('<span class="cat-links">'.esc_html__('Posted in %1$s', 'lighthouse').'</span>', $categories_list); // WPCS: XSS OK. |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /* translators: used between list items, there is a space after the comma */ |
| 56 | - $tags_list = get_the_tag_list( '', esc_html__( ', ', 'lighthouse' ) ); |
|
| 57 | - if ( $tags_list ) { |
|
| 58 | - printf( '<span class="tags-links">' . esc_html__( 'Tagged %1$s', 'lighthouse' ) . '</span>', $tags_list ); // WPCS: XSS OK. |
|
| 56 | + $tags_list = get_the_tag_list('', esc_html__(', ', 'lighthouse')); |
|
| 57 | + if ($tags_list) { |
|
| 58 | + printf('<span class="tags-links">'.esc_html__('Tagged %1$s', 'lighthouse').'</span>', $tags_list); // WPCS: XSS OK. |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { |
|
| 62 | + if ( ! is_single() && ! post_password_required() && (comments_open() || get_comments_number())) { |
|
| 63 | 63 | echo '<span class="comments-link">'; |
| 64 | - comments_popup_link( esc_html__( 'Leave a comment', 'lighthouse' ), esc_html__( '1 Comment', 'lighthouse' ), esc_html__( '% Comments', 'lighthouse' ) ); |
|
| 64 | + comments_popup_link(esc_html__('Leave a comment', 'lighthouse'), esc_html__('1 Comment', 'lighthouse'), esc_html__('% Comments', 'lighthouse')); |
|
| 65 | 65 | echo '</span>'; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | edit_post_link( |
| 69 | 69 | sprintf( |
| 70 | 70 | /* translators: %s: Name of current post */ |
| 71 | - esc_html__( 'Edit %s', 'lighthouse' ), |
|
| 72 | - the_title( '<span class="screen-reader-text">"', '"</span>', false ) |
|
| 71 | + esc_html__('Edit %s', 'lighthouse'), |
|
| 72 | + the_title('<span class="screen-reader-text">"', '"</span>', false) |
|
| 73 | 73 | ), |
| 74 | 74 | '<span class="edit-link">', |
| 75 | 75 | '</span>' |
@@ -83,22 +83,22 @@ discard block |
||
| 83 | 83 | * @return bool |
| 84 | 84 | */ |
| 85 | 85 | function lighthouse_categorized_blog() { |
| 86 | - if ( false === ( $all_the_cool_cats = get_transient( 'lighthouse_categories' ) ) ) { |
|
| 86 | + if (false === ($all_the_cool_cats = get_transient('lighthouse_categories'))) { |
|
| 87 | 87 | // Create an array of all the categories that are attached to posts. |
| 88 | - $all_the_cool_cats = get_categories( array( |
|
| 88 | + $all_the_cool_cats = get_categories(array( |
|
| 89 | 89 | 'fields' => 'ids', |
| 90 | 90 | 'hide_empty' => 1, |
| 91 | 91 | // We only need to know if there is more than one category. |
| 92 | 92 | 'number' => 2, |
| 93 | - ) ); |
|
| 93 | + )); |
|
| 94 | 94 | |
| 95 | 95 | // Count the number of categories that are attached to the posts. |
| 96 | - $all_the_cool_cats = count( $all_the_cool_cats ); |
|
| 96 | + $all_the_cool_cats = count($all_the_cool_cats); |
|
| 97 | 97 | |
| 98 | - set_transient( 'lighthouse_categories', $all_the_cool_cats ); |
|
| 98 | + set_transient('lighthouse_categories', $all_the_cool_cats); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - if ( $all_the_cool_cats > 1 ) { |
|
| 101 | + if ($all_the_cool_cats > 1) { |
|
| 102 | 102 | // This blog has more than 1 category so lighthouse_categorized_blog should return true. |
| 103 | 103 | return true; |
| 104 | 104 | } else { |
@@ -111,21 +111,21 @@ discard block |
||
| 111 | 111 | * Flush out the transients used in lighthouse_categorized_blog. |
| 112 | 112 | */ |
| 113 | 113 | function lighthouse_category_transient_flusher() { |
| 114 | - if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { |
|
| 114 | + if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { |
|
| 115 | 115 | return; |
| 116 | 116 | } |
| 117 | 117 | // Like, beat it. Dig? |
| 118 | - delete_transient( 'lighthouse_categories' ); |
|
| 118 | + delete_transient('lighthouse_categories'); |
|
| 119 | 119 | } |
| 120 | -add_action( 'edit_category', 'lighthouse_category_transient_flusher' ); |
|
| 121 | -add_action( 'save_post', 'lighthouse_category_transient_flusher' ); |
|
| 120 | +add_action('edit_category', 'lighthouse_category_transient_flusher'); |
|
| 121 | +add_action('save_post', 'lighthouse_category_transient_flusher'); |
|
| 122 | 122 | |
| 123 | 123 | /** |
| 124 | 124 | * Custom Header Menus |
| 125 | 125 | */ |
| 126 | 126 | //Left menu |
| 127 | 127 | function lighthouse_header_menu_left() { |
| 128 | - if ( has_nav_menu( 'header-menu-left' ) ) { |
|
| 128 | + if (has_nav_menu('header-menu-left')) { |
|
| 129 | 129 | wp_nav_menu( |
| 130 | 130 | array( |
| 131 | 131 | 'theme_location' => 'header-menu-left', |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | //Right menu |
| 153 | 153 | function lighthouse_header_menu_right() { |
| 154 | - if ( has_nav_menu( 'header-menu-right' ) ) { |
|
| 154 | + if (has_nav_menu('header-menu-right')) { |
|
| 155 | 155 | wp_nav_menu( |
| 156 | 156 | array( |
| 157 | 157 | 'theme_location' => 'header-menu-right', |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * @package Lighthouse |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -if ( ! function_exists( 'lighthouse_setup' ) ) : |
|
| 10 | +if ( ! function_exists('lighthouse_setup')) : |
|
| 11 | 11 | /** |
| 12 | 12 | * Sets up theme defaults and registers support for various WordPress features. |
| 13 | 13 | * |
@@ -22,10 +22,10 @@ discard block |
||
| 22 | 22 | * If you're building a theme based on Lighthouse, use a find and replace |
| 23 | 23 | * to change 'lighthouse' to the name of your theme in all the template files. |
| 24 | 24 | */ |
| 25 | - load_theme_textdomain( 'lighthouse', get_template_directory() . '/languages' ); |
|
| 25 | + load_theme_textdomain('lighthouse', get_template_directory().'/languages'); |
|
| 26 | 26 | |
| 27 | 27 | // Add default posts and comments RSS feed links to head. |
| 28 | - add_theme_support( 'automatic-feed-links' ); |
|
| 28 | + add_theme_support('automatic-feed-links'); |
|
| 29 | 29 | |
| 30 | 30 | /* |
| 31 | 31 | * Let WordPress manage the document title. |
@@ -33,19 +33,19 @@ discard block |
||
| 33 | 33 | * hard-coded <title> tag in the document head, and expect WordPress to |
| 34 | 34 | * provide it for us. |
| 35 | 35 | */ |
| 36 | - add_theme_support( 'title-tag' ); |
|
| 36 | + add_theme_support('title-tag'); |
|
| 37 | 37 | |
| 38 | 38 | /* |
| 39 | 39 | * Enable support for Post Thumbnails on posts and pages. |
| 40 | 40 | * |
| 41 | 41 | * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ |
| 42 | 42 | */ |
| 43 | - add_theme_support( 'post-thumbnails' ); |
|
| 43 | + add_theme_support('post-thumbnails'); |
|
| 44 | 44 | |
| 45 | 45 | // This theme uses wp_nav_menu() in one location. |
| 46 | - register_nav_menus( array( |
|
| 47 | - 'primary' => esc_html__( 'Primary', 'lighthouse' ), |
|
| 48 | - ) ); |
|
| 46 | + register_nav_menus(array( |
|
| 47 | + 'primary' => esc_html__('Primary', 'lighthouse'), |
|
| 48 | + )); |
|
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | /* |
@@ -55,45 +55,45 @@ discard block |
||
| 55 | 55 | function lighthouse_header_menus() { |
| 56 | 56 | register_nav_menus( |
| 57 | 57 | array( |
| 58 | - 'header-menu-left' => __( 'Header menu left', 'nav menu location', 'lighthouse' ), |
|
| 59 | - 'header-menu-right' => __( 'Header menu right' , 'nav menu location', 'lighthouse') |
|
| 58 | + 'header-menu-left' => __('Header menu left', 'nav menu location', 'lighthouse'), |
|
| 59 | + 'header-menu-right' => __('Header menu right', 'nav menu location', 'lighthouse') |
|
| 60 | 60 | ) |
| 61 | 61 | ); |
| 62 | 62 | } |
| 63 | - add_action( 'init', 'lighthouse_header_menus' ); |
|
| 63 | + add_action('init', 'lighthouse_header_menus'); |
|
| 64 | 64 | |
| 65 | 65 | /* |
| 66 | 66 | * Switch default core markup for search form, comment form, and comments |
| 67 | 67 | * to output valid HTML5. |
| 68 | 68 | */ |
| 69 | - add_theme_support( 'html5', array( |
|
| 69 | + add_theme_support('html5', array( |
|
| 70 | 70 | 'search-form', |
| 71 | 71 | 'comment-form', |
| 72 | 72 | 'comment-list', |
| 73 | 73 | 'gallery', |
| 74 | 74 | 'caption', |
| 75 | - ) ); |
|
| 75 | + )); |
|
| 76 | 76 | |
| 77 | 77 | /* |
| 78 | 78 | * Enable support for Post Formats. |
| 79 | 79 | * See https://developer.wordpress.org/themes/functionality/post-formats/ |
| 80 | 80 | */ |
| 81 | - add_theme_support( 'post-formats', array( |
|
| 81 | + add_theme_support('post-formats', array( |
|
| 82 | 82 | 'aside', |
| 83 | 83 | 'image', |
| 84 | 84 | 'video', |
| 85 | 85 | 'quote', |
| 86 | 86 | 'link', |
| 87 | - ) ); |
|
| 87 | + )); |
|
| 88 | 88 | |
| 89 | 89 | // Set up the WordPress core custom background feature. |
| 90 | - add_theme_support( 'custom-background', apply_filters( 'lighthouse_custom_background_args', array( |
|
| 90 | + add_theme_support('custom-background', apply_filters('lighthouse_custom_background_args', array( |
|
| 91 | 91 | 'default-color' => 'ffffff', |
| 92 | 92 | 'default-image' => '', |
| 93 | - ) ) ); |
|
| 93 | + ))); |
|
| 94 | 94 | } |
| 95 | 95 | endif; |
| 96 | -add_action( 'after_setup_theme', 'lighthouse_setup' ); |
|
| 96 | +add_action('after_setup_theme', 'lighthouse_setup'); |
|
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | 99 | * Set the content width in pixels, based on the theme's design and stylesheet. |
@@ -103,9 +103,9 @@ discard block |
||
| 103 | 103 | * @global int $content_width |
| 104 | 104 | */ |
| 105 | 105 | function lighthouse_content_width() { |
| 106 | - $GLOBALS['content_width'] = apply_filters( 'lighthouse_content_width', 640 ); |
|
| 106 | + $GLOBALS['content_width'] = apply_filters('lighthouse_content_width', 640); |
|
| 107 | 107 | } |
| 108 | -add_action( 'after_setup_theme', 'lighthouse_content_width', 0 ); |
|
| 108 | +add_action('after_setup_theme', 'lighthouse_content_width', 0); |
|
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | 111 | * Register widget area. |
@@ -113,66 +113,66 @@ discard block |
||
| 113 | 113 | * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar |
| 114 | 114 | */ |
| 115 | 115 | function lighthouse_widgets_init() { |
| 116 | - register_sidebar( array( |
|
| 117 | - 'name' => esc_html__( 'Sidebar', 'lighthouse' ), |
|
| 116 | + register_sidebar(array( |
|
| 117 | + 'name' => esc_html__('Sidebar', 'lighthouse'), |
|
| 118 | 118 | 'id' => 'sidebar-1', |
| 119 | 119 | 'description' => '', |
| 120 | 120 | 'before_widget' => '<section id="%1$s" class="widget %2$s">', |
| 121 | 121 | 'after_widget' => '</section>', |
| 122 | 122 | 'before_title' => '<h2 class="widget-title">', |
| 123 | 123 | 'after_title' => '</h2>', |
| 124 | - ) ); |
|
| 124 | + )); |
|
| 125 | 125 | } |
| 126 | -add_action( 'widgets_init', 'lighthouse_widgets_init' ); |
|
| 126 | +add_action('widgets_init', 'lighthouse_widgets_init'); |
|
| 127 | 127 | |
| 128 | 128 | /** |
| 129 | 129 | * Enqueue scripts and styles. |
| 130 | 130 | */ |
| 131 | 131 | function lighthouse_scripts() { |
| 132 | 132 | |
| 133 | - wp_enqueue_style( 'lighthouse-font-awesome-css', get_template_directory_uri() . '/css/font-awesome.min.css'); |
|
| 133 | + wp_enqueue_style('lighthouse-font-awesome-css', get_template_directory_uri().'/css/font-awesome.min.css'); |
|
| 134 | 134 | |
| 135 | - wp_enqueue_style( 'lighthouse-style', get_stylesheet_uri() ); |
|
| 135 | + wp_enqueue_style('lighthouse-style', get_stylesheet_uri()); |
|
| 136 | 136 | |
| 137 | 137 | wp_enqueue_style('lighthouse-google-fonts', 'https://fonts.googleapis.com/css?family=Questrial'); |
| 138 | 138 | |
| 139 | - wp_enqueue_script( 'lighthouse-bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '', true ); |
|
| 139 | + wp_enqueue_script('lighthouse-bootstrap-js', get_template_directory_uri().'/js/bootstrap.min.js', array('jquery'), '', true); |
|
| 140 | 140 | |
| 141 | - wp_enqueue_script( 'lighthouse-material-menu-js', get_template_directory_uri() . '/js/materialMenu.js', array('jquery'), '', true ); |
|
| 141 | + wp_enqueue_script('lighthouse-material-menu-js', get_template_directory_uri().'/js/materialMenu.js', array('jquery'), '', true); |
|
| 142 | 142 | |
| 143 | - wp_enqueue_script( 'lighthouse-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true ); |
|
| 143 | + wp_enqueue_script('lighthouse-navigation', get_template_directory_uri().'/js/navigation.js', array(), '20120206', true); |
|
| 144 | 144 | |
| 145 | - wp_enqueue_script( 'lighthouse-settings-js', get_template_directory_uri() . '/js/lighthouse-settings.js', array('jquery'), '', true ); |
|
| 145 | + wp_enqueue_script('lighthouse-settings-js', get_template_directory_uri().'/js/lighthouse-settings.js', array('jquery'), '', true); |
|
| 146 | 146 | |
| 147 | - wp_enqueue_script( 'lighthouse-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); |
|
| 147 | + wp_enqueue_script('lighthouse-skip-link-focus-fix', get_template_directory_uri().'/js/skip-link-focus-fix.js', array(), '20130115', true); |
|
| 148 | 148 | |
| 149 | - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { |
|
| 150 | - wp_enqueue_script( 'comment-reply' ); |
|
| 149 | + if (is_singular() && comments_open() && get_option('thread_comments')) { |
|
| 150 | + wp_enqueue_script('comment-reply'); |
|
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | -add_action( 'wp_enqueue_scripts', 'lighthouse_scripts' ); |
|
| 153 | +add_action('wp_enqueue_scripts', 'lighthouse_scripts'); |
|
| 154 | 154 | |
| 155 | 155 | /** |
| 156 | 156 | * Implement the Custom Header feature. |
| 157 | 157 | */ |
| 158 | -require get_template_directory() . '/inc/custom-header.php'; |
|
| 158 | +require get_template_directory().'/inc/custom-header.php'; |
|
| 159 | 159 | |
| 160 | 160 | /** |
| 161 | 161 | * Custom template tags for this theme. |
| 162 | 162 | */ |
| 163 | -require get_template_directory() . '/inc/template-tags.php'; |
|
| 163 | +require get_template_directory().'/inc/template-tags.php'; |
|
| 164 | 164 | |
| 165 | 165 | /** |
| 166 | 166 | * Custom functions that act independently of the theme templates. |
| 167 | 167 | */ |
| 168 | -require get_template_directory() . '/inc/extras.php'; |
|
| 168 | +require get_template_directory().'/inc/extras.php'; |
|
| 169 | 169 | |
| 170 | 170 | /** |
| 171 | 171 | * Customizer additions. |
| 172 | 172 | */ |
| 173 | -require get_template_directory() . '/inc/customizer.php'; |
|
| 173 | +require get_template_directory().'/inc/customizer.php'; |
|
| 174 | 174 | |
| 175 | 175 | /** |
| 176 | 176 | * Load Jetpack compatibility file. |
| 177 | 177 | */ |
| 178 | -require get_template_directory() . '/inc/jetpack.php'; |
|
| 178 | +require get_template_directory().'/inc/jetpack.php'; |
|