forked from vektor-inc/lightning
/
index.php
71 lines (62 loc) · 2.32 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php get_header(); ?>
<?php get_template_part('module_pageTit'); ?>
<?php get_template_part('module_panList'); ?>
<div class="section siteContent">
<div class="container">
<div class="row">
<main class="col-md-8 mainSection" id="main" role="main">
<?php
/*-------------------------------------------*/
/* Archive title
/*-------------------------------------------*/
$page_for_posts = lightning_get_page_for_posts();
// Use post top page( Archive title wrap to div )
if ( $page_for_posts['post_top_use'] || get_post_type() != 'post' ) {
if ( is_year() || is_month() || is_day() || is_tag() || is_author() || is_tax() || is_category() ) {
$archiveTitle = get_the_archive_title();
echo '<header class="archive-header"><h1>'. $archiveTitle .'</h1></header>';
}
}
?>
<?php
/*-------------------------------------------*/
/* Archive description
/*-------------------------------------------*/
if ( is_category() || is_tax() || is_tag() ) {
$category_description = term_description();
$page = get_query_var( 'paged', 0 );
if ( ! empty( $category_description ) && $page == 0 ) {
echo '<div class="archive-meta">' . $category_description . '</div>';
}
}
?>
<?php if (have_posts()) : ?>
<?php if( apply_filters( 'is_lightning_extend_loop' , false ) ): ?>
<?php do_action( 'lightning_extend_loop' ); ?>
<?php else: // extend loop() ?>
<div class="postList">
<?php while ( have_posts() ) : the_post();?>
<?php get_template_part('module_loop_post'); ?>
<?php endwhile;?>
</div>
<?php endif; // extend loop() ?>
<?php
the_posts_pagination(array (
'mid_size' => 1,
'prev_text' => '«',
'next_text' => '»',
'type' => 'list',
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __ ( 'Page', 'lightning' ) . ' </span>'
) );
?>
<?php else: ?>
<div class="well"><p><?php _e('No posts.','lightning');?></p></div>
<?php endif; // have_post() ?>
</main><!-- [ /.mainSection ] -->
<div class="col-md-3 col-md-offset-1 subSection">
<?php get_sidebar(get_post_type()); ?>
</div><!-- [ /.subSection ] -->
</div><!-- [ /.row ] -->
</div><!-- [ /.container ] -->
</div><!-- [ /.siteContent ] -->
<?php get_footer(); ?>