@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Lighthouse functions and definitions. |
|
| 4 | - * |
|
| 5 | - * @link https://developer.wordpress.org/themes/basics/theme-functions/ |
|
| 6 | - * |
|
| 7 | - * @package Lighthouse |
|
| 8 | - */ |
|
| 3 | + * Lighthouse functions and definitions. |
|
| 4 | + * |
|
| 5 | + * @link https://developer.wordpress.org/themes/basics/theme-functions/ |
|
| 6 | + * |
|
| 7 | + * @package Lighthouse |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | if ( ! function_exists( 'lighthouse_setup' ) ) : |
| 11 | 11 | /** |
@@ -167,12 +167,12 @@ discard block |
||
| 167 | 167 | * Read More button in excerpt |
| 168 | 168 | */ |
| 169 | 169 | function new_excerpt_more( $more ) { |
| 170 | - return ' '; |
|
| 170 | + return ' '; |
|
| 171 | 171 | } |
| 172 | 172 | add_filter( 'excerpt_more', 'new_excerpt_more' ); |
| 173 | 173 | /** |
| 174 | - * Implement the Custom Header feature. |
|
| 175 | - */ |
|
| 174 | + * Implement the Custom Header feature. |
|
| 175 | + */ |
|
| 176 | 176 | require get_template_directory() . '/inc/custom-header.php'; |
| 177 | 177 | |
| 178 | 178 | /** |
@@ -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,14 +33,14 @@ 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 | |
| 46 | 46 | /* |
@@ -48,12 +48,12 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * @link https://codex.wordpress.org/Function_Reference/get_search_form |
| 50 | 50 | */ |
| 51 | - add_theme_support( 'html5', array( 'search-form' ) ); |
|
| 51 | + add_theme_support('html5', array('search-form')); |
|
| 52 | 52 | |
| 53 | 53 | // This theme uses wp_nav_menu() in one location. |
| 54 | - register_nav_menus( array( |
|
| 55 | - 'primary' => esc_html__( 'Primary', 'lighthouse' ), |
|
| 56 | - ) ); |
|
| 54 | + register_nav_menus(array( |
|
| 55 | + 'primary' => esc_html__('Primary', 'lighthouse'), |
|
| 56 | + )); |
|
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | /* |
@@ -63,47 +63,47 @@ discard block |
||
| 63 | 63 | function lighthouse_menus() { |
| 64 | 64 | register_nav_menus( |
| 65 | 65 | array( |
| 66 | - 'header-menu-left' => __( 'Header menu left', 'nav menu location', 'lighthouse' ), |
|
| 67 | - 'header-menu-right' => __( 'Header menu right' , 'nav menu location', 'lighthouse'), |
|
| 68 | - 'footer-menu' => __( 'Footer menu' , 'nav menu location', 'lighthouse'), |
|
| 69 | - 'footer-menu-bottom' => __( 'Footer menu bottom' , 'nav menu location', 'lighthouse') |
|
| 66 | + 'header-menu-left' => __('Header menu left', 'nav menu location', 'lighthouse'), |
|
| 67 | + 'header-menu-right' => __('Header menu right', 'nav menu location', 'lighthouse'), |
|
| 68 | + 'footer-menu' => __('Footer menu', 'nav menu location', 'lighthouse'), |
|
| 69 | + 'footer-menu-bottom' => __('Footer menu bottom', 'nav menu location', 'lighthouse') |
|
| 70 | 70 | ) |
| 71 | 71 | ); |
| 72 | 72 | } |
| 73 | - add_action( 'init', 'lighthouse_menus' ); |
|
| 73 | + add_action('init', 'lighthouse_menus'); |
|
| 74 | 74 | |
| 75 | 75 | /* |
| 76 | 76 | * Switch default core markup for search form, comment form, and comments |
| 77 | 77 | * to output valid HTML5. |
| 78 | 78 | */ |
| 79 | - add_theme_support( 'html5', array( |
|
| 79 | + add_theme_support('html5', array( |
|
| 80 | 80 | 'search-form', |
| 81 | 81 | 'comment-form', |
| 82 | 82 | 'comment-list', |
| 83 | 83 | 'gallery', |
| 84 | 84 | 'caption', |
| 85 | - ) ); |
|
| 85 | + )); |
|
| 86 | 86 | |
| 87 | 87 | /* |
| 88 | 88 | * Enable support for Post Formats. |
| 89 | 89 | * See https://developer.wordpress.org/themes/functionality/post-formats/ |
| 90 | 90 | */ |
| 91 | - add_theme_support( 'post-formats', array( |
|
| 91 | + add_theme_support('post-formats', array( |
|
| 92 | 92 | 'aside', |
| 93 | 93 | 'image', |
| 94 | 94 | 'video', |
| 95 | 95 | 'quote', |
| 96 | 96 | 'link', |
| 97 | - ) ); |
|
| 97 | + )); |
|
| 98 | 98 | |
| 99 | 99 | // Set up the WordPress core custom background feature. |
| 100 | - add_theme_support( 'custom-background', apply_filters( 'lighthouse_custom_background_args', array( |
|
| 100 | + add_theme_support('custom-background', apply_filters('lighthouse_custom_background_args', array( |
|
| 101 | 101 | 'default-color' => 'ffffff', |
| 102 | 102 | 'default-image' => '', |
| 103 | - ) ) ); |
|
| 103 | + ))); |
|
| 104 | 104 | } |
| 105 | 105 | endif; |
| 106 | -add_action( 'after_setup_theme', 'lighthouse_setup' ); |
|
| 106 | +add_action('after_setup_theme', 'lighthouse_setup'); |
|
| 107 | 107 | |
| 108 | 108 | /** |
| 109 | 109 | * Set the content width in pixels, based on the theme's design and stylesheet. |
@@ -113,9 +113,9 @@ discard block |
||
| 113 | 113 | * @global int $content_width |
| 114 | 114 | */ |
| 115 | 115 | function lighthouse_content_width() { |
| 116 | - $GLOBALS['content_width'] = apply_filters( 'lighthouse_content_width', 640 ); |
|
| 116 | + $GLOBALS['content_width'] = apply_filters('lighthouse_content_width', 640); |
|
| 117 | 117 | } |
| 118 | -add_action( 'after_setup_theme', 'lighthouse_content_width', 0 ); |
|
| 118 | +add_action('after_setup_theme', 'lighthouse_content_width', 0); |
|
| 119 | 119 | |
| 120 | 120 | /** |
| 121 | 121 | * Register widget area. |
@@ -123,74 +123,74 @@ discard block |
||
| 123 | 123 | * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar |
| 124 | 124 | */ |
| 125 | 125 | function lighthouse_widgets_init() { |
| 126 | - register_sidebar( array( |
|
| 127 | - 'name' => esc_html__( 'Sidebar', 'lighthouse' ), |
|
| 126 | + register_sidebar(array( |
|
| 127 | + 'name' => esc_html__('Sidebar', 'lighthouse'), |
|
| 128 | 128 | 'id' => 'sidebar-1', |
| 129 | 129 | 'description' => '', |
| 130 | 130 | 'before_widget' => '<section id="%1$s" class="widget %2$s">', |
| 131 | 131 | 'after_widget' => '</section>', |
| 132 | 132 | 'before_title' => '<h2 class="widget-title">', |
| 133 | 133 | 'after_title' => '</h2>', |
| 134 | - ) ); |
|
| 134 | + )); |
|
| 135 | 135 | } |
| 136 | -add_action( 'widgets_init', 'lighthouse_widgets_init' ); |
|
| 136 | +add_action('widgets_init', 'lighthouse_widgets_init'); |
|
| 137 | 137 | |
| 138 | 138 | /** |
| 139 | 139 | * Enqueue scripts and styles. |
| 140 | 140 | */ |
| 141 | 141 | function lighthouse_scripts() { |
| 142 | 142 | |
| 143 | - wp_enqueue_style( 'lighthouse-font-awesome-css', get_template_directory_uri() . '/css/font-awesome.min.css'); |
|
| 143 | + wp_enqueue_style('lighthouse-font-awesome-css', get_template_directory_uri().'/css/font-awesome.min.css'); |
|
| 144 | 144 | |
| 145 | - wp_enqueue_style( 'lighthouse-style', get_stylesheet_uri() ); |
|
| 145 | + wp_enqueue_style('lighthouse-style', get_stylesheet_uri()); |
|
| 146 | 146 | |
| 147 | 147 | wp_enqueue_style('lighthouse-google-fonts', 'https://fonts.googleapis.com/css?family=Questrial'); |
| 148 | 148 | |
| 149 | - wp_enqueue_script( 'lighthouse-bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '', true ); |
|
| 149 | + wp_enqueue_script('lighthouse-bootstrap-js', get_template_directory_uri().'/js/bootstrap.min.js', array('jquery'), '', true); |
|
| 150 | 150 | |
| 151 | - wp_enqueue_script( 'lighthouse-material-menu-js', get_template_directory_uri() . '/js/materialMenu.js', array('jquery'), '', true ); |
|
| 151 | + wp_enqueue_script('lighthouse-material-menu-js', get_template_directory_uri().'/js/materialMenu.js', array('jquery'), '', true); |
|
| 152 | 152 | |
| 153 | - wp_enqueue_script( 'lighthouse-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true ); |
|
| 153 | + wp_enqueue_script('lighthouse-navigation', get_template_directory_uri().'/js/navigation.js', array(), '20120206', true); |
|
| 154 | 154 | |
| 155 | - wp_enqueue_script( 'lighthouse-settings-js', get_template_directory_uri() . '/js/lighthouse-settings.js', array('jquery'), '', true ); |
|
| 155 | + wp_enqueue_script('lighthouse-settings-js', get_template_directory_uri().'/js/lighthouse-settings.js', array('jquery'), '', true); |
|
| 156 | 156 | |
| 157 | - wp_enqueue_script( 'lighthouse-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); |
|
| 157 | + wp_enqueue_script('lighthouse-skip-link-focus-fix', get_template_directory_uri().'/js/skip-link-focus-fix.js', array(), '20130115', true); |
|
| 158 | 158 | |
| 159 | - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { |
|
| 160 | - wp_enqueue_script( 'comment-reply' ); |
|
| 159 | + if (is_singular() && comments_open() && get_option('thread_comments')) { |
|
| 160 | + wp_enqueue_script('comment-reply'); |
|
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | -add_action( 'wp_enqueue_scripts', 'lighthouse_scripts' ); |
|
| 163 | +add_action('wp_enqueue_scripts', 'lighthouse_scripts'); |
|
| 164 | 164 | |
| 165 | 165 | |
| 166 | 166 | /** |
| 167 | 167 | * Read More button in excerpt |
| 168 | 168 | */ |
| 169 | -function new_excerpt_more( $more ) { |
|
| 169 | +function new_excerpt_more($more) { |
|
| 170 | 170 | return ' '; |
| 171 | 171 | } |
| 172 | -add_filter( 'excerpt_more', 'new_excerpt_more' ); |
|
| 172 | +add_filter('excerpt_more', 'new_excerpt_more'); |
|
| 173 | 173 | /** |
| 174 | 174 | * Implement the Custom Header feature. |
| 175 | 175 | */ |
| 176 | -require get_template_directory() . '/inc/custom-header.php'; |
|
| 176 | +require get_template_directory().'/inc/custom-header.php'; |
|
| 177 | 177 | |
| 178 | 178 | /** |
| 179 | 179 | * Custom template tags for this theme. |
| 180 | 180 | */ |
| 181 | -require get_template_directory() . '/inc/template-tags.php'; |
|
| 181 | +require get_template_directory().'/inc/template-tags.php'; |
|
| 182 | 182 | |
| 183 | 183 | /** |
| 184 | 184 | * Custom functions that act independently of the theme templates. |
| 185 | 185 | */ |
| 186 | -require get_template_directory() . '/inc/extras.php'; |
|
| 186 | +require get_template_directory().'/inc/extras.php'; |
|
| 187 | 187 | |
| 188 | 188 | /** |
| 189 | 189 | * Customizer additions. |
| 190 | 190 | */ |
| 191 | -require get_template_directory() . '/inc/customizer.php'; |
|
| 191 | +require get_template_directory().'/inc/customizer.php'; |
|
| 192 | 192 | |
| 193 | 193 | /** |
| 194 | 194 | * Load Jetpack compatibility file. |
| 195 | 195 | */ |
| 196 | -require get_template_directory() . '/inc/jetpack.php'; |
|
| 196 | +require get_template_directory().'/inc/jetpack.php'; |
|
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Template Name: Blog |
|
| 4 | - * |
|
| 5 | - * @package Lighthouse |
|
| 6 | - */ |
|
| 3 | + * Template Name: Blog |
|
| 4 | + * |
|
| 5 | + * @package Lighthouse |
|
| 6 | + */ |
|
| 7 | 7 | get_header(); ?> |
| 8 | 8 | <div class="title-wrapper"> |
| 9 | 9 | <div class="container"> |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | <div class="container"> |
| 10 | 10 | <div class="row"> |
| 11 | 11 | <div class="col-md-6"> |
| 12 | - <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> |
|
| 12 | + <?php the_title('<h1 class="entry-title">', '</h1>'); ?>
|
|
| 13 | 13 | </div> |
| 14 | 14 | <div class="col-md-6 search-area"> |
| 15 | 15 | |
@@ -25,15 +25,15 @@ discard block |
||
| 25 | 25 | <div class="row"> |
| 26 | 26 | <div class="col-md-9 blog-listing"> |
| 27 | 27 | <?php |
| 28 | - $args = array( 'post_type' => 'post', 'posts_per_page' => -1 ); |
|
| 29 | - $loop = new WP_Query( $args ); |
|
| 28 | + $args = array('post_type' => 'post', 'posts_per_page' => -1);
|
|
| 29 | + $loop = new WP_Query($args); |
|
| 30 | 30 | $postid = get_the_ID(); |
| 31 | - while ( $loop->have_posts() ) : $loop->the_post();?> |
|
| 31 | + while ($loop->have_posts()) : $loop->the_post(); ?> |
|
| 32 | 32 | |
| 33 | 33 | <article id="post-<?php echo $postid; ?>"> |
| 34 | 34 | <div class="row blog-item"> |
| 35 | 35 | <?php |
| 36 | - $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full'); |
|
| 36 | + $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); |
|
| 37 | 37 | $url = $thumb[0]; |
| 38 | 38 | ?> |
| 39 | 39 | <div class="col-sm-5 blog-thumb"> |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | </div> |
| 69 | 69 | <div class="col-md-3 sidebar" role="complementary"> |
| 70 | - <?php dynamic_sidebar( 'blog_widgets' ); ?> |
|
| 70 | + <?php dynamic_sidebar('blog_widgets'); ?>
|
|
| 71 | 71 | </div> |
| 72 | 72 | </div><!-- .row --> |
| 73 | 73 | </div><!-- .container --> |
@@ -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 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', |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | //Fotter menu |
| 179 | 179 | function lighthouse_footer_menu() { |
| 180 | - if ( has_nav_menu( 'footer-menu' ) ) { |
|
| 180 | + if (has_nav_menu('footer-menu')) { |
|
| 181 | 181 | wp_nav_menu( |
| 182 | 182 | array( |
| 183 | 183 | 'theme_location' => 'footer-menu', |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | //Menu footer-bottom |
| 205 | 205 | function lighthouse_footer_menu_bottom() { |
| 206 | - if ( has_nav_menu( 'footer-menu-bottom' ) ) { |
|
| 206 | + if (has_nav_menu('footer-menu-bottom')) { |
|
| 207 | 207 | wp_nav_menu( |
| 208 | 208 | array( |
| 209 | 209 | 'theme_location' => 'footer-menu-bottom', |
@@ -235,56 +235,56 @@ discard block |
||
| 235 | 235 | //footer widgets |
| 236 | 236 | function footer_widgets_init() { |
| 237 | 237 | |
| 238 | - register_sidebar( array( |
|
| 238 | + register_sidebar(array( |
|
| 239 | 239 | 'name' => 'Footer Widgets #1', |
| 240 | - 'description' => __( 'Widgets displayed at footer.', 'lighthouse' ), |
|
| 240 | + 'description' => __('Widgets displayed at footer.', 'lighthouse'), |
|
| 241 | 241 | 'id' => 'footer_widgets_1', |
| 242 | 242 | 'before_widget' => '<div id="%1$s" class="widget %2$s">', |
| 243 | 243 | 'after_widget' => '</div>', |
| 244 | 244 | 'before_title' => '<h3 class="widget-title">', |
| 245 | 245 | 'after_title' => '</h3>', |
| 246 | - ) ); |
|
| 247 | - register_sidebar( array( |
|
| 246 | + )); |
|
| 247 | + register_sidebar(array( |
|
| 248 | 248 | 'name' => 'Footer Widgets #2', |
| 249 | - 'description' => __( 'Widgets displayed at footer.', 'lighthouse' ), |
|
| 249 | + 'description' => __('Widgets displayed at footer.', 'lighthouse'), |
|
| 250 | 250 | 'id' => 'footer_widgets_2', |
| 251 | 251 | 'before_widget' => '<div id="%1$s" class="widget %2$s">', |
| 252 | 252 | 'after_widget' => '</div>', |
| 253 | 253 | 'before_title' => '<h3 class="widget-title">', |
| 254 | 254 | 'after_title' => '</h3>', |
| 255 | - ) ); |
|
| 256 | - register_sidebar( array( |
|
| 255 | + )); |
|
| 256 | + register_sidebar(array( |
|
| 257 | 257 | 'name' => 'Footer Widgets #3', |
| 258 | - 'description' => __( 'Widgets displayed at footer.', 'lighthouse' ), |
|
| 258 | + 'description' => __('Widgets displayed at footer.', 'lighthouse'), |
|
| 259 | 259 | 'id' => 'footer_widgets_3', |
| 260 | 260 | 'before_widget' => '<div id="%1$s" class="widget %2$s">', |
| 261 | 261 | 'after_widget' => '</div>', |
| 262 | 262 | 'before_title' => '<h3 class="widget-title">', |
| 263 | 263 | 'after_title' => '</h3>', |
| 264 | - ) ); |
|
| 265 | - register_sidebar( array( |
|
| 264 | + )); |
|
| 265 | + register_sidebar(array( |
|
| 266 | 266 | 'name' => 'Footer Widgets #4', |
| 267 | - 'description' => __( 'Widgets displayed at footer.', 'lighthouse' ), |
|
| 267 | + 'description' => __('Widgets displayed at footer.', 'lighthouse'), |
|
| 268 | 268 | 'id' => 'footer_widgets_4', |
| 269 | 269 | 'before_widget' => '<div id="%1$s" class="widget %2$s">', |
| 270 | 270 | 'after_widget' => '</div>', |
| 271 | 271 | 'before_title' => '<h3 class="widget-title">', |
| 272 | 272 | 'after_title' => '</h3>', |
| 273 | - ) ); |
|
| 273 | + )); |
|
| 274 | 274 | } |
| 275 | -add_action( 'widgets_init', 'footer_widgets_init' ); |
|
| 275 | +add_action('widgets_init', 'footer_widgets_init'); |
|
| 276 | 276 | |
| 277 | 277 | //Blog sidebar widgets |
| 278 | 278 | function blog_widgets_init() { |
| 279 | 279 | |
| 280 | - register_sidebar( array( |
|
| 280 | + register_sidebar(array( |
|
| 281 | 281 | 'name' => 'Blog Sidebar', |
| 282 | - 'description' => __( 'Widgets displayed at blog page.', 'lighthouse' ), |
|
| 282 | + 'description' => __('Widgets displayed at blog page.', 'lighthouse'), |
|
| 283 | 283 | 'id' => 'blog_widgets', |
| 284 | 284 | 'before_widget' => '<div id="%1$s" class="widget %2$s">', |
| 285 | 285 | 'after_widget' => '</div>', |
| 286 | 286 | 'before_title' => '<h3 class="widget-title">', |
| 287 | 287 | 'after_title' => '</h3>', |
| 288 | - ) ); |
|
| 288 | + )); |
|
| 289 | 289 | } |
| 290 | -add_action( 'widgets_init', 'blog_widgets_init' ); |
|
| 291 | 290 | \ No newline at end of file |
| 291 | +add_action('widgets_init', 'blog_widgets_init'); |
|
| 292 | 292 | \ No newline at end of file |