Make WordPress Themes

source: lightning/11.4.6/index.php

Last change on this file was 134769, checked in by themedropbox, 5 years ago

New version of Lightning - 11.4.6

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