This repository has been archived by the owner on Feb 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
96 lines (71 loc) · 2.91 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/**
* The main template file.
*
* @package nano-progga
*/
get_header(); ?>
<div id="primary" class="content-area col-md-12">
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?>
<div id="infinite-scroll-holder" class="row grid">
<?php
//get the nano progga theme settings from Theme Options page.
$widgets_positioning = cs_get_option('widgets_positioning');
/* Start the Loop */
$_counter = 0;
while ( have_posts() ) : the_post(); ?>
<?php
//Determine the pagination
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
//Show widgets only on the first page or not
if( cs_get_option( 'widgets_in_pages' ) || 1 === $paged ) :
//First Widget
$widget_1_pos = $widgets_positioning['home_widget_1'] ? (int) $widgets_positioning['home_widget_1'] : 3;
if( $_counter === $widget_1_pos && is_active_sidebar( 'home_widget_1' ) )
dynamic_sidebar( 'home_widget_1' );
//Second Widget
$widget_2_pos = $widgets_positioning['home_widget_2'] ? (int) $widgets_positioning['home_widget_2'] : 4;
if( $_counter === $widget_2_pos && is_active_sidebar( 'home_widget_2' ) )
dynamic_sidebar( 'home_widget_2' );
//Third Widget
$widget_3_pos = $widgets_positioning['home_widget_3'] ? (int) $widgets_positioning['home_widget_3'] : 6;
if( $_counter === $widget_3_pos && is_active_sidebar( 'home_widget_3' ) )
dynamic_sidebar( 'home_widget_3' );
//Fourth Widget
$widget_4_pos = $widgets_positioning['home_widget_4'] ? (int) $widgets_positioning['home_widget_4'] : 8;
if( $_counter === $widget_4_pos && is_active_sidebar( 'home_widget_4' ) )
dynamic_sidebar( 'home_widget_4' );
//Fifth Widget
$widget_5_pos = $widgets_positioning['home_widget_5'] ? (int) $widgets_positioning['home_widget_5'] : 9;
if( $_counter === $widget_5_pos && is_active_sidebar( 'home_widget_5' ) )
dynamic_sidebar( 'home_widget_5' );
endif;
?>
<div <?php post_class("grid-item article-holder col-sm-4"); ?>>
<div class="article-area">
<?php
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'template-parts/content', get_post_format() );
?>
</div> <!-- /.article-area -->
</div> <!-- /.article-holder col-md-6 -->
<?php
$_counter++;
endwhile;
?>
</div> <!-- /.row -->
<?php nano_progga_pagination(); ?>
<?php else : ?>
<div class="row">
<?php get_template_part( 'template-parts/content', 'none' ); ?>
</div> <!-- /.row -->
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php //get_sidebar(); ?>
<?php get_footer(); ?>