@@ -252,7 +252,9 @@ discard block |
||
252 | 252 | $showitems = ($range * 2)+1; |
253 | 253 | |
254 | 254 | global $paged; |
255 | - if(empty($paged)) $paged = 1; |
|
255 | + if(empty($paged)) { |
|
256 | + $paged = 1; |
|
257 | + } |
|
256 | 258 | |
257 | 259 | if($pages == '') |
258 | 260 | { |
@@ -267,8 +269,12 @@ discard block |
||
267 | 269 | if(1 != $pages) |
268 | 270 | { |
269 | 271 | echo "<div class=\"pagination\"><span>Page ".$paged." of ".$pages."</span>"; |
270 | - if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>« First</a>"; |
|
271 | - if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>‹ Previous</a>"; |
|
272 | + if($paged > 2 && $paged > $range+1 && $showitems < $pages) { |
|
273 | + echo "<a href='".get_pagenum_link(1)."'>« First</a>"; |
|
274 | + } |
|
275 | + if($paged > 1 && $showitems < $pages) { |
|
276 | + echo "<a href='".get_pagenum_link($paged - 1)."'>‹ Previous</a>"; |
|
277 | + } |
|
272 | 278 | |
273 | 279 | for ($i=1; $i <= $pages; $i++) |
274 | 280 | { |
@@ -278,8 +284,12 @@ discard block |
||
278 | 284 | } |
279 | 285 | } |
280 | 286 | |
281 | - if ($paged < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next ›</a>"; |
|
282 | - if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last »</a>"; |
|
287 | + if ($paged < $pages && $showitems < $pages) { |
|
288 | + echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next ›</a>"; |
|
289 | + } |
|
290 | + if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) { |
|
291 | + echo "<a href='".get_pagenum_link($pages)."'>Last »</a>"; |
|
292 | + } |
|
283 | 293 | echo "</div>\n"; |
284 | 294 | } |
285 | 295 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * Read More button in excerpt |
179 | 179 | */ |
180 | 180 | function new_excerpt_more( $more ) { |
181 | - return '... <a class="readmore" href="' . get_permalink() . ' ">Read more <i class="fa fa-external-link"></i></a>'; |
|
181 | + return '... <a class="readmore" href="' . get_permalink() . ' ">Read more <i class="fa fa-external-link"></i></a>'; |
|
182 | 182 | } |
183 | 183 | add_filter( 'excerpt_more', 'new_excerpt_more' ); |
184 | 184 | |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | echo '</div></div>'; |
238 | 238 | |
239 | 239 | endwhile; |
240 | - wp_reset_postdata(); |
|
240 | + wp_reset_postdata(); |
|
241 | 241 | endif; |
242 | 242 | |
243 | 243 | echo '</div></div>'; |
@@ -249,39 +249,39 @@ discard block |
||
249 | 249 | // Numbered Pagination |
250 | 250 | function pagination($pages = '', $range = 4) |
251 | 251 | { |
252 | - $showitems = ($range * 2)+1; |
|
252 | + $showitems = ($range * 2)+1; |
|
253 | 253 | |
254 | - global $paged; |
|
255 | - if(empty($paged)) $paged = 1; |
|
254 | + global $paged; |
|
255 | + if(empty($paged)) $paged = 1; |
|
256 | 256 | |
257 | - if($pages == '') |
|
258 | - { |
|
259 | - global $wp_query; |
|
260 | - $pages = $wp_query->max_num_pages; |
|
261 | - if(!$pages) |
|
262 | - { |
|
263 | - $pages = 1; |
|
264 | - } |
|
265 | - } |
|
257 | + if($pages == '') |
|
258 | + { |
|
259 | + global $wp_query; |
|
260 | + $pages = $wp_query->max_num_pages; |
|
261 | + if(!$pages) |
|
262 | + { |
|
263 | + $pages = 1; |
|
264 | + } |
|
265 | + } |
|
266 | 266 | |
267 | - if(1 != $pages) |
|
268 | - { |
|
269 | - echo "<div class=\"pagination\"><span>Page ".$paged." of ".$pages."</span>"; |
|
270 | - if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>« First</a>"; |
|
271 | - if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>‹ Previous</a>"; |
|
267 | + if(1 != $pages) |
|
268 | + { |
|
269 | + echo "<div class=\"pagination\"><span>Page ".$paged." of ".$pages."</span>"; |
|
270 | + if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>« First</a>"; |
|
271 | + if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>‹ Previous</a>"; |
|
272 | 272 | |
273 | - for ($i=1; $i <= $pages; $i++) |
|
274 | - { |
|
275 | - if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) |
|
276 | - { |
|
277 | - echo ($paged == $i)? "<span class=\"current\">".$i."</span>":"<a href='".get_pagenum_link($i)."' class=\"inactive\">".$i."</a>"; |
|
278 | - } |
|
279 | - } |
|
273 | + for ($i=1; $i <= $pages; $i++) |
|
274 | + { |
|
275 | + if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) |
|
276 | + { |
|
277 | + echo ($paged == $i)? "<span class=\"current\">".$i."</span>":"<a href='".get_pagenum_link($i)."' class=\"inactive\">".$i."</a>"; |
|
278 | + } |
|
279 | + } |
|
280 | 280 | |
281 | - if ($paged < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next ›</a>"; |
|
282 | - if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last »</a>"; |
|
283 | - echo "</div>\n"; |
|
284 | - } |
|
281 | + if ($paged < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next ›</a>"; |
|
282 | + if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last »</a>"; |
|
283 | + echo "</div>\n"; |
|
284 | + } |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | /** |
@@ -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,32 +33,32 @@ 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 | - add_image_size( 'lighthouse_feature_img', 1000, 310, array( 'center', 'center' ) ); |
|
45 | + add_image_size('lighthouse_feature_img', 1000, 310, array('center', 'center')); |
|
46 | 46 | |
47 | - add_image_size( 'lighthouse_blog_listing', 714, 274, array( 'center', 'center' ) ); |
|
47 | + add_image_size('lighthouse_blog_listing', 714, 274, array('center', 'center')); |
|
48 | 48 | |
49 | - add_image_size( 'lighthouse_related_post', 475, 280, array( 'center', 'center' ) ); |
|
49 | + add_image_size('lighthouse_related_post', 475, 280, array('center', 'center')); |
|
50 | 50 | |
51 | 51 | /* |
52 | 52 | * Default HTML5 Form |
53 | 53 | * |
54 | 54 | * @link https://codex.wordpress.org/Function_Reference/get_search_form |
55 | 55 | */ |
56 | - add_theme_support( 'html5', array( 'search-form' ) ); |
|
56 | + add_theme_support('html5', array('search-form')); |
|
57 | 57 | |
58 | 58 | // This theme uses wp_nav_menu() in one location. |
59 | - register_nav_menus( array( |
|
60 | - 'primary' => esc_html__( 'Primary', 'lighthouse' ), |
|
61 | - ) ); |
|
59 | + register_nav_menus(array( |
|
60 | + 'primary' => esc_html__('Primary', 'lighthouse'), |
|
61 | + )); |
|
62 | 62 | |
63 | 63 | |
64 | 64 | /* |
@@ -68,47 +68,47 @@ discard block |
||
68 | 68 | function lighthouse_menus() { |
69 | 69 | register_nav_menus( |
70 | 70 | array( |
71 | - 'header-menu-left' => __( 'Header menu left', 'nav menu location', 'lighthouse' ), |
|
72 | - 'header-menu-right' => __( 'Header menu right' , 'nav menu location', 'lighthouse'), |
|
73 | - 'footer-menu' => __( 'Footer menu' , 'nav menu location', 'lighthouse'), |
|
74 | - 'footer-menu-bottom' => __( 'Footer menu bottom' , 'nav menu location', 'lighthouse') |
|
71 | + 'header-menu-left' => __('Header menu left', 'nav menu location', 'lighthouse'), |
|
72 | + 'header-menu-right' => __('Header menu right', 'nav menu location', 'lighthouse'), |
|
73 | + 'footer-menu' => __('Footer menu', 'nav menu location', 'lighthouse'), |
|
74 | + 'footer-menu-bottom' => __('Footer menu bottom', 'nav menu location', 'lighthouse') |
|
75 | 75 | ) |
76 | 76 | ); |
77 | 77 | } |
78 | - add_action( 'init', 'lighthouse_menus' ); |
|
78 | + add_action('init', 'lighthouse_menus'); |
|
79 | 79 | |
80 | 80 | /* |
81 | 81 | * Switch default core markup for search form, comment form, and comments |
82 | 82 | * to output valid HTML5. |
83 | 83 | */ |
84 | - add_theme_support( 'html5', array( |
|
84 | + add_theme_support('html5', array( |
|
85 | 85 | 'search-form', |
86 | 86 | 'comment-form', |
87 | 87 | 'comment-list', |
88 | 88 | 'gallery', |
89 | 89 | 'caption', |
90 | - ) ); |
|
90 | + )); |
|
91 | 91 | |
92 | 92 | /* |
93 | 93 | * Enable support for Post Formats. |
94 | 94 | * See https://developer.wordpress.org/themes/functionality/post-formats/ |
95 | 95 | */ |
96 | - add_theme_support( 'post-formats', array( |
|
96 | + add_theme_support('post-formats', array( |
|
97 | 97 | 'aside', |
98 | 98 | 'image', |
99 | 99 | 'video', |
100 | 100 | 'quote', |
101 | 101 | 'link', |
102 | - ) ); |
|
102 | + )); |
|
103 | 103 | |
104 | 104 | // Set up the WordPress core custom background feature. |
105 | - add_theme_support( 'custom-background', apply_filters( 'lighthouse_custom_background_args', array( |
|
105 | + add_theme_support('custom-background', apply_filters('lighthouse_custom_background_args', array( |
|
106 | 106 | 'default-color' => 'ffffff', |
107 | 107 | 'default-image' => '', |
108 | - ) ) ); |
|
108 | + ))); |
|
109 | 109 | } |
110 | 110 | endif; |
111 | -add_action( 'after_setup_theme', 'lighthouse_setup' ); |
|
111 | +add_action('after_setup_theme', 'lighthouse_setup'); |
|
112 | 112 | |
113 | 113 | /** |
114 | 114 | * Set the content width in pixels, based on the theme's design and stylesheet. |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | * @global int $content_width |
119 | 119 | */ |
120 | 120 | function lighthouse_content_width() { |
121 | - $GLOBALS['content_width'] = apply_filters( 'lighthouse_content_width', 640 ); |
|
121 | + $GLOBALS['content_width'] = apply_filters('lighthouse_content_width', 640); |
|
122 | 122 | } |
123 | -add_action( 'after_setup_theme', 'lighthouse_content_width', 0 ); |
|
123 | +add_action('after_setup_theme', 'lighthouse_content_width', 0); |
|
124 | 124 | |
125 | 125 | /** |
126 | 126 | * Register widget area. |
@@ -128,61 +128,61 @@ discard block |
||
128 | 128 | * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar |
129 | 129 | */ |
130 | 130 | function lighthouse_widgets_init() { |
131 | - register_sidebar( array( |
|
132 | - 'name' => esc_html__( 'Sidebar', 'lighthouse' ), |
|
131 | + register_sidebar(array( |
|
132 | + 'name' => esc_html__('Sidebar', 'lighthouse'), |
|
133 | 133 | 'id' => 'sidebar-1', |
134 | 134 | 'description' => '', |
135 | 135 | 'before_widget' => '<section id="%1$s" class="widget %2$s">', |
136 | 136 | 'after_widget' => '</section>', |
137 | 137 | 'before_title' => '<h2 class="widget-title">', |
138 | 138 | 'after_title' => '</h2>', |
139 | - ) ); |
|
139 | + )); |
|
140 | 140 | } |
141 | -add_action( 'widgets_init', 'lighthouse_widgets_init' ); |
|
141 | +add_action('widgets_init', 'lighthouse_widgets_init'); |
|
142 | 142 | |
143 | 143 | /** |
144 | 144 | * Enqueue scripts and styles. |
145 | 145 | */ |
146 | 146 | function lighthouse_scripts() { |
147 | 147 | |
148 | - wp_enqueue_style( 'lighthouse-font-awesome-css', get_template_directory_uri() . '/css/font-awesome.min.css'); |
|
148 | + wp_enqueue_style('lighthouse-font-awesome-css', get_template_directory_uri().'/css/font-awesome.min.css'); |
|
149 | 149 | |
150 | - wp_enqueue_style( 'lighthouse-style', get_stylesheet_uri() ); |
|
150 | + wp_enqueue_style('lighthouse-style', get_stylesheet_uri()); |
|
151 | 151 | |
152 | 152 | wp_enqueue_style('lighthouse-google-fonts', 'https://fonts.googleapis.com/css?family=Questrial'); |
153 | 153 | |
154 | 154 | //wp_enqueue_style('lighthouse-owl-carousel-css', get_template_directory_uri() . '/css/owl.carousel.css'); |
155 | 155 | |
156 | - wp_enqueue_script( 'lighthouse-classList-js', 'https://cdnjs.cloudflare.com/ajax/libs/classlist/2014.01.31/classList.min.js', array('jquery'), ''); |
|
156 | + wp_enqueue_script('lighthouse-classList-js', 'https://cdnjs.cloudflare.com/ajax/libs/classlist/2014.01.31/classList.min.js', array('jquery'), ''); |
|
157 | 157 | |
158 | - wp_enqueue_script( 'lighthouse-bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '', true ); |
|
158 | + wp_enqueue_script('lighthouse-bootstrap-js', get_template_directory_uri().'/js/bootstrap.min.js', array('jquery'), '', true); |
|
159 | 159 | |
160 | - wp_enqueue_script( 'lighthouse-material-menu-js', get_template_directory_uri() . '/js/materialMenu.js', array('jquery'), '', true ); |
|
160 | + wp_enqueue_script('lighthouse-material-menu-js', get_template_directory_uri().'/js/materialMenu.js', array('jquery'), '', true); |
|
161 | 161 | |
162 | - wp_enqueue_script( 'lighthouse-owl-carousel-js', get_template_directory_uri() . '/js/owl-carousel.js', array('jquery'), '', true ); |
|
162 | + wp_enqueue_script('lighthouse-owl-carousel-js', get_template_directory_uri().'/js/owl-carousel.js', array('jquery'), '', true); |
|
163 | 163 | |
164 | - wp_enqueue_script( 'lighthouse-match-height-js', get_template_directory_uri() . '/js/jquery.matchHeight-min.js', array('jquery'), '', true ); |
|
164 | + wp_enqueue_script('lighthouse-match-height-js', get_template_directory_uri().'/js/jquery.matchHeight-min.js', array('jquery'), '', true); |
|
165 | 165 | |
166 | - wp_enqueue_script( 'lighthouse-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true ); |
|
166 | + wp_enqueue_script('lighthouse-navigation', get_template_directory_uri().'/js/navigation.js', array(), '20120206', true); |
|
167 | 167 | |
168 | - wp_enqueue_script( 'lighthouse-settings-js', get_template_directory_uri() . '/js/lighthouse-settings.js', array('jquery'), '', true ); |
|
168 | + wp_enqueue_script('lighthouse-settings-js', get_template_directory_uri().'/js/lighthouse-settings.js', array('jquery'), '', true); |
|
169 | 169 | |
170 | - wp_enqueue_script( 'lighthouse-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); |
|
170 | + wp_enqueue_script('lighthouse-skip-link-focus-fix', get_template_directory_uri().'/js/skip-link-focus-fix.js', array(), '20130115', true); |
|
171 | 171 | |
172 | - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { |
|
173 | - wp_enqueue_script( 'comment-reply' ); |
|
172 | + if (is_singular() && comments_open() && get_option('thread_comments')) { |
|
173 | + wp_enqueue_script('comment-reply'); |
|
174 | 174 | } |
175 | 175 | } |
176 | -add_action( 'wp_enqueue_scripts', 'lighthouse_scripts' ); |
|
176 | +add_action('wp_enqueue_scripts', 'lighthouse_scripts'); |
|
177 | 177 | |
178 | 178 | |
179 | 179 | /** |
180 | 180 | * Read More button in excerpt |
181 | 181 | */ |
182 | -function new_excerpt_more( $more ) { |
|
183 | - return '... <a class="readmore" href="' . get_permalink() . ' ">Read more <i class="fa fa-external-link"></i></a>'; |
|
182 | +function new_excerpt_more($more) { |
|
183 | + return '... <a class="readmore" href="'.get_permalink().' ">Read more <i class="fa fa-external-link"></i></a>'; |
|
184 | 184 | } |
185 | -add_filter( 'excerpt_more', 'new_excerpt_more' ); |
|
185 | +add_filter('excerpt_more', 'new_excerpt_more'); |
|
186 | 186 | |
187 | 187 | /** |
188 | 188 | * Custome Lenght of excerpt |
@@ -194,13 +194,13 @@ discard block |
||
194 | 194 | |
195 | 195 | |
196 | 196 | //callback function for the 'clear_content' shortcode |
197 | -function recent_post_slider($atts){ |
|
197 | +function recent_post_slider($atts) { |
|
198 | 198 | |
199 | 199 | echo'<div class="post-slider row"><div id="recent-posts" class="owl-carousel">'; |
200 | 200 | |
201 | 201 | global $post; |
202 | 202 | |
203 | - $post_query = new WP_Query( array( |
|
203 | + $post_query = new WP_Query(array( |
|
204 | 204 | 'post_type' => 'post', |
205 | 205 | 'posts_per_page' => 12, |
206 | 206 | 'order'=>'DESC', |
@@ -208,31 +208,31 @@ discard block |
||
208 | 208 | ) |
209 | 209 | ); |
210 | 210 | |
211 | - if( $post_query->have_posts() ) : while( $post_query->have_posts() ) : $post_query->the_post(); |
|
211 | + if ($post_query->have_posts()) : while ($post_query->have_posts()) : $post_query->the_post(); |
|
212 | 212 | |
213 | - $thumb_post = wp_get_attachment_image_src( get_post_thumbnail_id(), 'lighthouse_related_post'); |
|
213 | + $thumb_post = wp_get_attachment_image_src(get_post_thumbnail_id(), 'lighthouse_related_post'); |
|
214 | 214 | $url_post = $thumb_post[0]; |
215 | 215 | $content = get_the_content(); |
216 | 216 | |
217 | 217 | echo '<div class="col-xs-12"><div class="thumbnail thumbnail-hover">'; |
218 | 218 | |
219 | - echo'<img class="img-responsive" src=" ' . $url_post . '">'; |
|
219 | + echo'<img class="img-responsive" src=" '.$url_post.'">'; |
|
220 | 220 | |
221 | - echo '<a href=" ' . get_permalink() .' " " title=" ' . get_the_title() .' " class="overlay"></a>'; |
|
221 | + echo '<a href=" '.get_permalink().' " " title=" '.get_the_title().' " class="overlay"></a>'; |
|
222 | 222 | |
223 | 223 | echo'</div>'; |
224 | 224 | |
225 | 225 | echo'<div class="entry">'; |
226 | 226 | |
227 | - echo '<h3><a href=" ' . get_permalink() . ' "> ' . get_the_title() . '</a></h3>'; |
|
227 | + echo '<h3><a href=" '.get_permalink().' "> '.get_the_title().'</a></h3>'; |
|
228 | 228 | |
229 | - echo '<span class="date"> <i class="fa fa-clock-o"></i> ' . get_the_time(get_option('date_format')) .'</span>'; |
|
229 | + echo '<span class="date"> <i class="fa fa-clock-o"></i> '.get_the_time(get_option('date_format')).'</span>'; |
|
230 | 230 | |
231 | - echo '<div class="entry-content">' . wp_trim_words( $content , '27' ) . '</div>'; |
|
231 | + echo '<div class="entry-content">'.wp_trim_words($content, '27').'</div>'; |
|
232 | 232 | |
233 | 233 | echo '<div class="read-more">'; |
234 | 234 | |
235 | - echo '<a href="' . get_permalink() . ' " class="btn read-more-btn">View Article</a>'; |
|
235 | + echo '<a href="'.get_permalink().' " class="btn read-more-btn">View Article</a>'; |
|
236 | 236 | |
237 | 237 | echo '</div>'; |
238 | 238 | |
@@ -246,42 +246,42 @@ discard block |
||
246 | 246 | |
247 | 247 | } |
248 | 248 | //add the new 'recent_posts' shortcode |
249 | -add_shortcode('recent_posts','recent_post_slider'); |
|
249 | +add_shortcode('recent_posts', 'recent_post_slider'); |
|
250 | 250 | |
251 | 251 | // Numbered Pagination |
252 | 252 | function pagination($pages = '', $range = 4) |
253 | 253 | { |
254 | - $showitems = ($range * 2)+1; |
|
254 | + $showitems = ($range * 2) + 1; |
|
255 | 255 | |
256 | 256 | global $paged; |
257 | - if(empty($paged)) $paged = 1; |
|
257 | + if (empty($paged)) $paged = 1; |
|
258 | 258 | |
259 | - if($pages == '') |
|
259 | + if ($pages == '') |
|
260 | 260 | { |
261 | 261 | global $wp_query; |
262 | 262 | $pages = $wp_query->max_num_pages; |
263 | - if(!$pages) |
|
263 | + if ( ! $pages) |
|
264 | 264 | { |
265 | 265 | $pages = 1; |
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
269 | - if(1 != $pages) |
|
269 | + if (1 != $pages) |
|
270 | 270 | { |
271 | 271 | echo "<div class=\"pagination\"><span>Page ".$paged." of ".$pages."</span>"; |
272 | - if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>« First</a>"; |
|
273 | - if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>‹ Previous</a>"; |
|
272 | + if ($paged > 2 && $paged > $range + 1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>« First</a>"; |
|
273 | + if ($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>‹ Previous</a>"; |
|
274 | 274 | |
275 | - for ($i=1; $i <= $pages; $i++) |
|
275 | + for ($i = 1; $i <= $pages; $i++) |
|
276 | 276 | { |
277 | - if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) |
|
277 | + if (1 != $pages && ( ! ($i >= $paged + $range + 1 || $i <= $paged - $range - 1) || $pages <= $showitems)) |
|
278 | 278 | { |
279 | - echo ($paged == $i)? "<span class=\"current\">".$i."</span>":"<a href='".get_pagenum_link($i)."' class=\"inactive\">".$i."</a>"; |
|
279 | + echo ($paged == $i) ? "<span class=\"current\">".$i."</span>" : "<a href='".get_pagenum_link($i)."' class=\"inactive\">".$i."</a>"; |
|
280 | 280 | } |
281 | 281 | } |
282 | 282 | |
283 | 283 | if ($paged < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next ›</a>"; |
284 | - if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last »</a>"; |
|
284 | + if ($paged < $pages - 1 && $paged + $range - 1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last »</a>"; |
|
285 | 285 | echo "</div>\n"; |
286 | 286 | } |
287 | 287 | } |
@@ -289,24 +289,24 @@ discard block |
||
289 | 289 | /** |
290 | 290 | * Implement the Custom Header feature. |
291 | 291 | */ |
292 | -require get_template_directory() . '/inc/custom-header.php'; |
|
292 | +require get_template_directory().'/inc/custom-header.php'; |
|
293 | 293 | |
294 | 294 | /** |
295 | 295 | * Custom template tags for this theme. |
296 | 296 | */ |
297 | -require get_template_directory() . '/inc/template-tags.php'; |
|
297 | +require get_template_directory().'/inc/template-tags.php'; |
|
298 | 298 | |
299 | 299 | /** |
300 | 300 | * Custom functions that act independently of the theme templates. |
301 | 301 | */ |
302 | -require get_template_directory() . '/inc/extras.php'; |
|
302 | +require get_template_directory().'/inc/extras.php'; |
|
303 | 303 | |
304 | 304 | /** |
305 | 305 | * Customizer additions. |
306 | 306 | */ |
307 | -require get_template_directory() . '/inc/customizer.php'; |
|
307 | +require get_template_directory().'/inc/customizer.php'; |
|
308 | 308 | |
309 | 309 | /** |
310 | 310 | * Load Jetpack compatibility file. |
311 | 311 | */ |
312 | -require get_template_directory() . '/inc/jetpack.php'; |
|
312 | +require get_template_directory().'/inc/jetpack.php'; |
@@ -1,9 +1,9 @@ discard block |
||
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 blog-wrapper"> |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | <div class="row"> |
68 | 68 | <div class="col-xs-12"> |
69 | 69 | <?php if (function_exists("pagination")) { |
70 | - pagination($loop->max_num_pages); |
|
70 | + pagination($loop->max_num_pages); |
|
71 | 71 | } ?> |
72 | 72 | </div> |
73 | 73 | </div> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | <div class="container blog-wrapper"> |
10 | 10 | <div class="row"> |
11 | 11 | <div class="col-xs-12"> |
12 | - <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> |
|
12 | + <?php the_title('<h1 class="entry-title">', '</h1>'); ?> |
|
13 | 13 | <h3 class="sub-title">Read the latest articles, commentary in our news blogs</h3> |
14 | 14 | </div> |
15 | 15 | </div> |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | <div class="row"> |
20 | 20 | <div class="col-md-9 content-listing"> |
21 | 21 | <?php |
22 | - $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; |
|
22 | + $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; |
|
23 | 23 | $args = array( |
24 | 24 | 'post_type' => 'post', |
25 | 25 | 'posts_per_page' => 6, |
26 | 26 | 'paged' => $paged |
27 | 27 | ); |
28 | - $loop = new WP_Query( $args ); |
|
29 | - while($loop->have_posts()) : $loop->the_post(); |
|
28 | + $loop = new WP_Query($args); |
|
29 | + while ($loop->have_posts()) : $loop->the_post(); |
|
30 | 30 | |
31 | 31 | $postid = get_the_ID(); |
32 | 32 | ?> |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | <article id="post-<?php echo $postid; ?>"> |
35 | 35 | <div class="row blog-item"> |
36 | 36 | <?php |
37 | - $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), 'lighthouse_blog_listing'); |
|
37 | + $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'lighthouse_blog_listing'); |
|
38 | 38 | $url = $thumb[0]; |
39 | 39 | $content = get_the_content(); |
40 | 40 | ?> |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | <span class="date"><?php the_time(get_option('date_format')) ?></span> |
54 | 54 | </div> |
55 | 55 | <div class="entry-content"> |
56 | - <?php echo wp_trim_words( $content , '18' ) ?> |
|
56 | + <?php echo wp_trim_words($content, '18') ?> |
|
57 | 57 | </div> |
58 | 58 | <div class="read-more"> |
59 | 59 | <a href="<?php the_permalink() ?>" class="btn read-more-btn">Read More</a> |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | </div> |
75 | 75 | </div> |
76 | 76 | <div class="col-md-3 sidebar" role="complementary"> |
77 | - <?php dynamic_sidebar( 'blog_widgets' ); ?> |
|
77 | + <?php dynamic_sidebar('blog_widgets'); ?> |
|
78 | 78 | </div> |
79 | 79 | </div><!-- .row --> |
80 | 80 | </div><!-- .container --> |
@@ -12,17 +12,17 @@ discard block |
||
12 | 12 | ?><!DOCTYPE html> |
13 | 13 | <html <?php language_attributes(); ?>> |
14 | 14 | <head> |
15 | - <meta charset="<?php bloginfo( 'charset' ); ?>"> |
|
15 | + <meta charset="<?php bloginfo('charset'); ?>"> |
|
16 | 16 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
17 | 17 | <link rel="profile" href="http://gmpg.org/xfn/11"> |
18 | - <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> |
|
18 | + <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>"> |
|
19 | 19 | |
20 | 20 | <?php wp_head(); ?> |
21 | 21 | </head> |
22 | 22 | |
23 | 23 | <body <?php body_class(); ?>> |
24 | 24 | <div id="page" class="site"> |
25 | - <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'lighthouse' ); ?></a> |
|
25 | + <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e('Skip to content', 'lighthouse'); ?></a> |
|
26 | 26 | |
27 | 27 | <header id="masthead" class="site-header panel-top panel-fixed" role="banner"> |
28 | 28 | <div class="container"> |
@@ -37,13 +37,13 @@ discard block |
||
37 | 37 | </div> |
38 | 38 | <div class="col-md-6 top-search hidden-xs hidden-sm"> |
39 | 39 | |
40 | - <form role="search" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>"> |
|
40 | + <form role="search" method="get" action="<?php echo esc_url(home_url('/')); ?>"> |
|
41 | 41 | <div class="search-wrap"> |
42 | - <label class="screen-reader-text" for="s"><?php _e( 'Search for:', 'presentation' ); ?></label> |
|
42 | + <label class="screen-reader-text" for="s"><?php _e('Search for:', 'presentation'); ?></label> |
|
43 | 43 | <button type="submit"> |
44 | 44 | <i class="fa fa-search"></i> |
45 | 45 | </button> |
46 | - <input type="search" placeholder="<?php echo esc_attr( 'Search', 'presentation' ); ?>" name="s" value="<?php echo esc_attr( get_search_query() ); ?>" /> |
|
46 | + <input type="search" placeholder="<?php echo esc_attr('Search', 'presentation'); ?>" name="s" value="<?php echo esc_attr(get_search_query()); ?>" /> |
|
47 | 47 | </div> |
48 | 48 | </form> |
49 | 49 | |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | </div> |
58 | 58 | </div> |
59 | 59 | <div class="col-sm-12 col-md-2 col-lg-2 header-center-area"> |
60 | - <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"> |
|
61 | - <img src="<?php echo( get_header_image() ); ?>" alt="<?php echo( get_bloginfo( 'title' ) ); ?>" /> |
|
60 | + <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"> |
|
61 | + <img src="<?php echo(get_header_image()); ?>" alt="<?php echo(get_bloginfo('title')); ?>" /> |
|
62 | 62 | </a> |
63 | 63 | |
64 | 64 | <div class="iv-module live-search"> |
@@ -71,9 +71,9 @@ discard block |
||
71 | 71 | <div class="container"> |
72 | 72 | <div class="row"> |
73 | 73 | <div class="col-md-12"> |
74 | - <form method="get" action="<?php echo esc_url( home_url( '/' ) );?>"> |
|
75 | - <label for="s"><?php _e('Type & hit enter to search', 'ivan_domain');?></label> |
|
76 | - <input type="search" name="s" id="s" placeholder="<?php echo esc_attr__('Type & hit enter to search', 'lighthouse');?>" /> |
|
74 | + <form method="get" action="<?php echo esc_url(home_url('/')); ?>"> |
|
75 | + <label for="s"><?php _e('Type & hit enter to search', 'ivan_domain'); ?></label> |
|
76 | + <input type="search" name="s" id="s" placeholder="<?php echo esc_attr__('Type & hit enter to search', 'lighthouse'); ?>" /> |
|
77 | 77 | <a class="submit-form" href="#"><i class="fa fa-search"></i></a> |
78 | 78 | <div class="clearfix"></div> |
79 | 79 | </form> |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | <div class="container"> |
101 | 101 | <div class="row"> |
102 | 102 | <div class="col-md-12"> |
103 | - <form method="get" action="<?php echo esc_url( home_url( '/' ) );?>"> |
|
104 | - <label for="s"><?php _e('Type & hit enter', 'ivan_domain');?></label> |
|
105 | - <input type="search" name="s" id="s" placeholder="<?php echo esc_attr__('Type & hit enter', 'lighthouse');?>" /> |
|
103 | + <form method="get" action="<?php echo esc_url(home_url('/')); ?>"> |
|
104 | + <label for="s"><?php _e('Type & hit enter', 'ivan_domain'); ?></label> |
|
105 | + <input type="search" name="s" id="s" placeholder="<?php echo esc_attr__('Type & hit enter', 'lighthouse'); ?>" /> |
|
106 | 106 | <a class="submit-form" href="#"><i class="fa fa-search"></i></a> |
107 | 107 | <div class="clearfix"></div> |
108 | 108 | </form> |