@@ -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 | /** |
@@ -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 | /** |
@@ -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"> |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | <div class="row"> |
| 69 | 69 | <div class="col-xs-12"> |
| 70 | 70 | <?php if (function_exists("pagination")) {
|
| 71 | - pagination($loop->max_num_pages); |
|
| 71 | + pagination($loop->max_num_pages); |
|
| 72 | 72 | } ?> |
| 73 | 73 | </div> |
| 74 | 74 | </div> |