-
Notifications
You must be signed in to change notification settings - Fork 0
/
front-page.php
216 lines (173 loc) · 7.73 KB
/
front-page.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<?php get_header(); ?>
<div id="page-wrap">
<?php
//this is the option on the page options
$pegasus_container_choice = get_post_meta( get_the_ID(), 'pegasus-page-container-checkbox', true );
//this is the option from the theme options for global fullwidth
$full_container_chk_choice = pegasus_theme_get_option('full_container_chk' );
//$meta2 = get_post_meta($post->ID);
//echo "<pre>"; var_dump($meta2); echo "</pre><hr>";
//echo $pegasus_container_choice;
?>
<div class="<?php if($full_container_chk_choice === 'on') {
echo 'container-fluid';
}elseif ($pegasus_container_choice === 'on') {
echo 'container-fluid';
}else{
echo 'container';
}?>">
<!-- Example row of columns -->
<div class="row">
<div class="inner-content">
<div class="content-no-sidebar clearfix">
<?php
$cat_args = array(
'orderby' => 'name',
'order' => 'DESC',
'parent' => 0
);
$categories = get_categories( $cat_args );
foreach($categories as $cat) :
?>
<?php
$query = new WP_Query(array(
'post_type' => array( 'post' ),
//'tagportfolio' => 'featured',
//'term'=>$term->slug,
'posts_per_page' => -1,
//'order' => 'DESC',
//'orderby' => 'date'
"category_name" => $cat->slug,
) );
$posts_count = 1;
//echo "<pre>"; var_dump($cat); echo "</pre><hr>";
$category_id = get_cat_ID( $cat->cat_name );
// Get the URL of this category
$category_link = get_category_link( $category_id );
?>
<a href="<?php echo esc_url( $category_link ); ?>"><h2 class="cat-year"><?php echo $cat->cat_name ?></h2></a>
<section class="meow-we-talkin-timeline cd-timeline">
<?php
while ( $query->have_posts() ) : $query->the_post();
++$posts_count;
?>
<?php
if ( has_post_thumbnail() ) {
$thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full', false, '' );
}/*else{
$thumb_url = array( get_template_directory_uri() . "/images/banner.png", "1");
}*/
?>
<?php
//conditional for even
if($posts_count % 2):
?>
<!--odd -->
<article class="article-<?php the_ID(); ?> cd-timeline-block right">
<div class="cd-timeline-img cd-picture">
<?php ?>
<time datetime="<?php the_date('c'); ?>">
<span class="mth"><?php print get_the_date( 'M' ); ?></span>
<span class="day"><?php print get_the_date( 'j' ); ?></span>
</time>
<?php ?>
</div> <!-- cd-timeline-img -->
<div class="inside-content cd-timeline-content">
<h2 class="featured-title"><?php the_title(); ?></h2>
<?php if($thumb_url) { ?>
<a href="<?php the_permalink(); ?>" class="image-container" style="background: url('<?php echo $thumb_url[0];?>') center center no-repeat;">
</a>
<?php } ?>
<!-- output the excerpt, and if no excerpt then output content-->
<div class="timeline-featured-content ">
<?php
$octane_excerpt = get_the_excerpt();
if(isset($octane_excerpt)) { ?>
<p>
<?php
$temporary_excerpt = substr(strip_tags($octane_excerpt), 0, 130);
echo $temporary_excerpt;
?>
</p>
<?php }else{
$more = 0;
$octane_content = get_the_content();
$temporary = substr(strip_tags($octane_content), 0, 130); ?>
<p>
<?php echo $temporary; ?>
</p>
<?php } ?>
</div>
<span class="cd-date"><?php print get_the_date( 'M j Y' ); ?></span>
<div class="timeline-footer clearfix">
<a href="<?php the_permalink(); ?>" class="cd-read-more">Read more</a>
</div>
</div><!--inside content -->
<div class="inside-content cd-timeline-content timeline-featured-image left">
<?php if($thumb_url) { ?>
<a href="<?php the_permalink(); ?>" class="image-container" style="background: url('<?php echo $thumb_url[0];?>') center center no-repeat;">
</a>
<?php } ?>
</div><!--inside content -->
</article><!-- cd-timeline-block -->
<?php else: ?>
<!-- even -->
<article class="article-<?php the_ID(); ?> cd-timeline-block left">
<div class="cd-timeline-img cd-picture">
<?php ?>
<time datetime="<?php the_date('c'); ?>">
<span class="mth"><?php print get_the_date( 'M' ); ?></span>
<span class="day"><?php print get_the_date( 'j' ); ?></span>
</time>
<?php ?>
</div> <!-- cd-timeline-img -->
<div class="inside-content cd-timeline-content">
<h2 class="featured-title"><?php the_title(); ?></h2>
<?php if($thumb_url) { ?>
<a href="<?php the_permalink(); ?>" class="image-container" style="background: url('<?php echo $thumb_url[0];?>') center center no-repeat;">
</a>
<?php } ?>
<!-- output the excerpt, and if no excerpt then output content-->
<div class="timeline-featured-content ">
<?php
$octane_excerpt = get_the_excerpt();
if(isset($octane_excerpt)) { ?>
<p>
<?php
$temporary_excerpt = substr(strip_tags($octane_excerpt), 0, 130);
echo $temporary_excerpt;
?>
</p>
<?php }else{
$more = 0;
$octane_content = get_the_content();
$temporary = substr(strip_tags($octane_content), 0, 130); ?>
<p>
<?php echo $temporary; ?>
</p>
<?php } ?>
</div>
<span class="cd-date"><?php print get_the_date( 'M j Y' ); ?></span>
<div class="timeline-footer clearfix">
<a href="<?php the_permalink(); ?>" class="cd-read-more">Read more</a>
</div>
</div><!--inside content -->
<div class="inside-content cd-timeline-content timeline-featured-image right">
<?php if($thumb_url) { ?>
<a href="<?php the_permalink(); ?>" class="image-container" style="background: url('<?php echo $thumb_url[0];?>') center center no-repeat;">
</a>
<?php } ?>
</div><!--inside content -->
</article><!-- cd-timeline-block -->
<?php endif; ?>
<?php endwhile;
wp_reset_query();
?>
</section>
<?php endforeach; ?>
</div>
</div><!--end inner content-->
</div><!--end row -->
</div><!-- end container -->
</div><!-- end page wrap -->
<?php get_footer(); ?>