Make WordPress Themes

source: lightning/7.2.4/index.php

Last change on this file was 121168, checked in by themedropbox, 6 years ago

New version of Lightning - 7.2.4

File size: 4.1 KB
Line 
1<?php get_header(); ?>
2
3<?php
4// Dealing with old files.
5// Actually, it's ok to only use get_template_part().
6/*-------------------------------------------*/
7/* Page Header
8/*-------------------------------------------*/
9$old_file_name[] = 'module_pageTit.php';
10if ( locate_template( $old_file_name, false, false ) ) {
11        locate_template( $old_file_name, true, false );
12} else {
13        get_template_part( 'template-parts/page-header' );
14}
15/*-------------------------------------------*/
16/* BreadCrumb
17/*-------------------------------------------*/
18$old_file_name[] = 'module_panList.php';
19if ( locate_template( $old_file_name, false, false ) ) {
20        locate_template( $old_file_name, true, false );
21} else {
22        get_template_part( 'template-parts/breadcrumb' );
23}
24?>
25
26<div class="section siteContent">
27<?php do_action( 'lightning_siteContent_prepend' ); ?>
28<div class="container">
29<?php do_action( 'lightning_siteContent_container_prepend' ); ?>
30<div class="row">
31<div class="<?php lightning_the_class_name( 'mainSection' ); ?>" id="main" role="main">
32<?php do_action( 'lightning_mainSection_prepend' ); ?>
33
34        <?php
35        /*-------------------------------------------*/
36        /*  Archive title
37        /*-------------------------------------------*/
38        $archiveTitle_html = '';
39        $page_for_posts    = lightning_get_page_for_posts();
40        // Use post top page( Archive title wrap to div ).
41        if ( $page_for_posts['post_top_use'] || get_post_type() !== 'post' ) {
42                if ( is_year() || is_month() || is_day() || is_tag() || is_author() || is_tax() || is_category() ) {
43                        $archiveTitle      = get_the_archive_title();
44                        $archiveTitle_html = '<header class="archive-header"><h1>' . $archiveTitle . '</h1></header>';
45                }
46        }
47        echo wp_kses_post( apply_filters( 'lightning_mainSection_archiveTitle', $archiveTitle_html ) );
48
49        /*-------------------------------------------*/
50        /*  Archive description
51        /*-------------------------------------------*/
52        $archiveDescription_html = '';
53        if ( is_category() || is_tax() || is_tag() ) {
54                $archiveDescription = term_description();
55                $page_number        = get_query_var( 'paged', 0 );
56                if ( ! empty( $archiveDescription ) && $page_number == 0 ) {
57                        $archiveDescription_html = '<div class="archive-meta">' . $archiveDescription . '</div>';
58                }
59        }
60        echo wp_kses_post( apply_filters( 'lightning_mainSection_archiveDescription', $archiveDescription_html ) );
61
62        $postType = lightning_get_post_type();
63
64        do_action( 'lightning_loop_before' );
65?>
66
67<div class="postList">
68
69<?php if ( have_posts() ) : ?>
70
71        <?php if ( apply_filters( 'is_lightning_extend_loop', false ) ) { ?>
72
73                <?php do_action( 'lightning_extend_loop' ); ?>
74
75        <?php } else { ?>
76
77                <?php
78                while ( have_posts() ) {
79                        the_post();
80
81                        /**
82                         * Dealing with old files
83                         * Actually, it's ok to only use get_template_part().
84                         * It is measure for before version 7.0 that loaded module_loop_***.php.
85                         */
86                        $old_file_name[] = 'module_loop_' . $postType['slug'] . '.php';
87                        $old_file_name[] = 'module_loop_post.php';
88                        $require_once    = false;
89                        if ( locate_template( $old_file_name, false, $require_once ) ) {
90                                locate_template( $old_file_name, true, $require_once );
91                        } else {
92                                get_template_part( 'template-parts/post/loop', $postType['slug'] );
93                        }
94                } // while ( have_posts() ) {
95                ?>
96
97        <?php } // loop() ?>
98
99        <?php
100        the_posts_pagination(
101                array(
102                        'mid_size'           => 1,
103                        'prev_text'          => '&laquo;',
104                        'next_text'          => '&raquo;',
105                        'type'               => 'list',
106                        'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'lightning' ) . ' </span>',
107                )
108        );
109        ?>
110
111        <?php else : // hove_posts() ?>
112
113  <div class="well"><p><?php echo wp_kses_post( apply_filters( 'lightning_no_posts_text', __( 'No posts.', 'lightning' ) ) ); ?></p></div>
114
115<?php endif; // have_post() ?>
116
117</div><!-- [ /.postList ] -->
118
119<?php do_action( 'lightning_loop_after' ); ?>
120<?php do_action( 'lightning_mainSection_append' ); ?>
121</div><!-- [ /.mainSection ] -->
122
123<div class="<?php lightning_the_class_name( 'sideSection' ); ?>">
124<?php get_sidebar( get_post_type() ); ?>
125</div><!-- [ /.subSection ] -->
126
127</div><!-- [ /.row ] -->
128</div><!-- [ /.container ] -->
129</div><!-- [ /.siteContent ] -->
130<?php get_footer(); ?>
Note: See TracBrowser for help on using the repository browser.