-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
133 lines (133 loc) · 4.46 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
/**
* The main template file
*
* @author Vtrois <[email protected]>
* @license GPL-3.0
* @since 1.0
*/
get_header();if(is_home() && dobby_option('index_status')){ ?>
<main class="main home-page bg-white">
<?php if (dobby_option("carousel_status")) { ?>
<div class="container-fluid">
<div id="home-slider" class="slider row">
<div class="flexslider">
<ul class="slides">
<?php dobby_carousel(); ?>
</ul>
</div>
</div>
</div>
<?php } ?>
<?php if (dobby_option('index_project_1')) { ?>
<div class="sort">
<div class="container">
<div class="row">
<div class="col-12 text-center">
<h2><?php echo dobby_option('index_project_1'); ?></h2>
<p class="mt-4"><?php echo dobby_option('index_meta_1'); ?></p>
</div>
</div>
<div class="row">
<div class="col-12">
<ul class="sortc-list">
<?php query_posts(array('posts_per_page'=>4, 'post__in' => explode(',', dobby_option('index_single_1'))));?>
<?php while (have_posts()) : the_post(); ?>
<li class="sortc" style="background-image: url(<?php echo dobby_thumbnail_url(); ?>); ">
<a href="<?php the_permalink(); ?>" class="text-white">
<div class="meta">
<span><?php foreach((get_the_category()) as $category) { echo $category->cat_name; } ?></span>
<h2><?php the_title(); ?></h2>
</div>
</a>
</li>
<?php endwhile;wp_reset_query(); ?>
</ul>
</div>
</div>
</div>
</div>
<?php } if (dobby_option('index_project_2')) { ?>
<div class="sort bg-light">
<div class="container">
<div class="row">
<div class="col-12 text-center">
<h2><?php echo dobby_option('index_project_2'); ?></h2>
<p class="mt-4"><?php echo dobby_option('index_meta_2'); ?></p>
</div>
</div>
<div class="row">
<?php query_posts('showposts=6&cat=' . dobby_option('index_category_2') . '')?>
<?php while (have_posts()) : the_post(); ?>
<div class="col-lg-4 col-md-6">
<div class="sortb sortb my-3 my-lg-4">
<a href="<?php the_permalink() ?>"><img class="thumbnail" src="<?php echo dobby_thumbnail_url(); ?>" alt=""></a>
<div class="meta">
<h3><a href="<?php the_permalink(); ?>" class="text-dark"><?php the_title(); ?></a></h3>
<span class="category"><?php foreach((get_the_category()) as $category) { echo $category->cat_name; } ?></span>
<p><?php echo wp_trim_words(get_the_excerpt(),150); ?></p>
</div>
</div>
</div>
<?php endwhile;wp_reset_query(); ?>
</div>
</div>
</div>
<?php } if (dobby_option('index_project_3')) { ?>
<div class="sort">
<div class="container">
<div class="row">
<div class="col-12 text-center">
<h2><?php echo dobby_option('index_project_3'); ?></h2>
<p class="mt-4"><?php echo dobby_option('index_meta_3'); ?></p>
</div>
</div>
<div class="row">
<?php query_posts('showposts=6&cat=' . dobby_option('index_category_3') . '')?>
<?php while (have_posts()) : the_post(); ?>
<div class="col-md-6 col-lg-4">
<div class="sorta sortb my-3 my-lg-4" style="background-image:url(<?php echo dobby_thumbnail_url(); ?>);">
<a href="<?php the_permalink(); ?>" class="desc text-dark">
<span><?php foreach((get_the_category()) as $category) { echo $category->cat_name; } ?></span>
<h3 class="mt-2"><?php the_title(); ?></h3>
</a>
</div>
</div>
<?php endwhile;wp_reset_query(); ?>
</div>
</div>
</div>
<?php } ?>
</main>
<?php } elseif(is_home()){?>
<main class="main index-page bg-light pb-4">
<?php if (dobby_option("carousel_status")) { ?>
<div class="container-fluid">
<div id="home-slider" class="slider row">
<div class="flexslider">
<ul class="slides">
<?php dobby_carousel(); ?>
</ul>
</div>
</div>
</div>
<?php } ?>
<div class="container pt-4">
<div class="row">
<div class="col-lg-8">
<div class="gamma-list">
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $query = new WP_Query( array('paged'=> $paged ));while (have_posts()) : the_post();get_template_part('/inc/content/content', get_post_format());endwhile;wp_reset_query(); ?>
</div>
<div class="more text-center mt-4" id="articlepage">
<?php next_posts_link( __('Load More' , 'dobby') ) ; ?>
</div>
</div>
<aside class="aside-widget col-lg-4 d-none d-lg-block d-xl-block">
<div id="stickyindex">
<?php dynamic_sidebar('sidebar_index'); ?>
</div>
</aside>
</div>
</div>
</main>
<?php }; get_footer(); ?>