| 1 | <?php get_header(); ?> |
|---|
| 2 | |
|---|
| 3 | <?php get_template_part( 'module_pageTit' ); ?> |
|---|
| 4 | <?php get_template_part( 'module_panList' ); ?> |
|---|
| 5 | |
|---|
| 6 | <div class="section siteContent"> |
|---|
| 7 | <div class="container"> |
|---|
| 8 | <div class="row"> |
|---|
| 9 | |
|---|
| 10 | <div class="col-md-8 mainSection" id="main" role="main"> |
|---|
| 11 | |
|---|
| 12 | <?php |
|---|
| 13 | /*-------------------------------------------*/ |
|---|
| 14 | /* Archive title |
|---|
| 15 | /*-------------------------------------------*/ |
|---|
| 16 | $page_for_posts = lightning_get_page_for_posts(); |
|---|
| 17 | // Use post top page( Archive title wrap to div ) |
|---|
| 18 | if ( $page_for_posts['post_top_use'] || get_post_type() != 'post' ) { |
|---|
| 19 | if ( is_year() || is_month() || is_day() || is_tag() || is_author() || is_tax() || is_category() ) { |
|---|
| 20 | $archiveTitle = get_the_archive_title(); |
|---|
| 21 | $archiveTitle_html = '<header class="archive-header"><h1>' . $archiveTitle . '</h1></header>'; |
|---|
| 22 | echo wp_kses_post( apply_filters( 'lightning_mainSection_archiveTitle', $archiveTitle_html ) ); |
|---|
| 23 | } |
|---|
| 24 | } |
|---|
| 25 | |
|---|
| 26 | /*-------------------------------------------*/ |
|---|
| 27 | /* Archive description |
|---|
| 28 | /*-------------------------------------------*/ |
|---|
| 29 | if ( is_category() || is_tax() || is_tag() ) { |
|---|
| 30 | $category_description = term_description(); |
|---|
| 31 | $page = get_query_var( 'paged', 0 ); |
|---|
| 32 | if ( ! empty( $category_description ) && $page == 0 ) { |
|---|
| 33 | $archiveDescription_html = '<div class="archive-meta">' . $category_description . '</div>'; |
|---|
| 34 | echo wp_kses_post( apply_filters( 'lightning_mainSection_archiveDescription', $archiveDescription_html ) ); |
|---|
| 35 | } |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 38 | $postType = lightning_get_post_type(); |
|---|
| 39 | |
|---|
| 40 | do_action( 'lightning_loop_before' ); |
|---|
| 41 | ?> |
|---|
| 42 | |
|---|
| 43 | <div class="postList"> |
|---|
| 44 | |
|---|
| 45 | <?php if ( have_posts() ) : ?> |
|---|
| 46 | |
|---|
| 47 | <?php if ( apply_filters( 'is_lightning_extend_loop', false ) ) : ?> |
|---|
| 48 | |
|---|
| 49 | <?php do_action( 'lightning_extend_loop' ); ?> |
|---|
| 50 | |
|---|
| 51 | <?php elseif ( file_exists( get_stylesheet_directory() . '/module_loop_' . $postType['slug'] . '.php' ) && $postType != 'post' ) : ?> |
|---|
| 52 | |
|---|
| 53 | <?php |
|---|
| 54 | while ( have_posts() ) : |
|---|
| 55 | the_post(); |
|---|
| 56 | ?> |
|---|
| 57 | <?php get_template_part( 'module_loop_' . $postType['slug'] ); ?> |
|---|
| 58 | <?php endwhile; ?> |
|---|
| 59 | |
|---|
| 60 | <?php else : ?> |
|---|
| 61 | |
|---|
| 62 | <?php |
|---|
| 63 | while ( have_posts() ) : |
|---|
| 64 | the_post(); |
|---|
| 65 | ?> |
|---|
| 66 | <?php get_template_part( 'module_loop_post' ); ?> |
|---|
| 67 | <?php endwhile; ?> |
|---|
| 68 | |
|---|
| 69 | <?php endif; // loop() ?> |
|---|
| 70 | |
|---|
| 71 | <?php |
|---|
| 72 | the_posts_pagination( |
|---|
| 73 | array( |
|---|
| 74 | 'mid_size' => 1, |
|---|
| 75 | 'prev_text' => '«', |
|---|
| 76 | 'next_text' => '»', |
|---|
| 77 | 'type' => 'list', |
|---|
| 78 | 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'lightning' ) . ' </span>', |
|---|
| 79 | ) |
|---|
| 80 | ); |
|---|
| 81 | ?> |
|---|
| 82 | |
|---|
| 83 | <?php else : // hove_posts() ?> |
|---|
| 84 | |
|---|
| 85 | <div class="well"><p><?php _e( 'No posts.', 'lightning' ); ?></p></div> |
|---|
| 86 | |
|---|
| 87 | <?php endif; // have_post() ?> |
|---|
| 88 | |
|---|
| 89 | </div><!-- [ /.postList ] --> |
|---|
| 90 | |
|---|
| 91 | <?php do_action( 'lightning_loop_after' ); ?> |
|---|
| 92 | |
|---|
| 93 | </div><!-- [ /.mainSection ] --> |
|---|
| 94 | |
|---|
| 95 | <div class="col-md-3 col-md-offset-1 subSection sideSection"> |
|---|
| 96 | <?php get_sidebar( get_post_type() ); ?> |
|---|
| 97 | </div><!-- [ /.subSection ] --> |
|---|
| 98 | |
|---|
| 99 | </div><!-- [ /.row ] --> |
|---|
| 100 | </div><!-- [ /.container ] --> |
|---|
| 101 | </div><!-- [ /.siteContent ] --> |
|---|
| 102 | <?php get_footer(); ?> |
|---|