-
Notifications
You must be signed in to change notification settings - Fork 0
/
_front-page.php
218 lines (179 loc) · 6.88 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
217
218
<?php
/**
* Template Name: New custom Page
* The template for the front page.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package TribeEventsCalendar
**/
?>
<?php get_header(); ?>
<div id="content" class="clearfix row dark">
<div id="main" class="col col-md-10 col-md-offset-1 clearfix" role="main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
<header>
<!--<div class="page-header"><h1><?php the_title(); ?></h1></div>-->
</header> <!-- end article header -->
<section class="post_content">
<div class="wide-box-holder slider">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<?php
$class_active="active";
$args=array(
'post_type'=> 'post',
'post_status' => 'publish',
'category_name' => 'featured',
'posts_per_page' => 5,
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class="item <?php echo $class_active ;?>">
<?php the_post_thumbnail('front-page-slide'); ?>
<div class="container">
<div class="caro-caps">
<h2> <?php the_title(); ?> </h2>
<p> <?php the_excerpt();?> </p>
</div>
</div>
</div>
<?php
$class_active="";
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
?>
</div>
</div>
</div>
</section> <!-- end article section -->
</article>
</div>
</div>
<div class="row trio">
<div class="col-md-10 col-md-offset-1">
<div class="col-md-4">
<a class="twitter-timeline" href="https://twitter.com/hashtag/VCUSocy" data-widget-id="691693878869651456">#VCUSocy Tweets</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<div class="col-md-4">
<?php
// The Reviews Query + the hashtag - shows only the first two submitted
$args = array(
'posts_per_page' => 5,
'order' => 'DSC',
'cat' => -2,
);
$the_query = new WP_Query( $args );
// The Loop
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo '<a href="' . get_the_permalink() . '"><div class="news">';
echo the_post_thumbnail('thumbnail' , array( 'class' => 'alignleft' )) . '<br/><h3>' . get_the_title() . '</h3><div class="news_excerpt">' . get_the_excerpt() . " . . . <br/> (click for more)";
echo '</div></div></a>';
}
} else {
// no posts found
echo 'No posts found';
}
/* Restore original Post Data */
wp_reset_postdata();
?>
</div>
<div class="col-md-4">
<div class="outline news">
<?php
$now = date("Y-m-d G:i:s");
$proj_events = tribe_get_events( array(
'start_date' => date( 'Y-m-d H:i:s', strtotime( '+1 day') ),
'end_date' => date( 'Y-m-d H:i:s', strtotime( '+1 week' ) ),
'eventDisplay' => 'custom',
'posts_per_page' => -1,
'tax_query'=> array(
array(
'taxonomy' => 'tribe_events_cat',
'field' => 'slug',
'terms' => 'long-term',
'operator' => 'NOT IN',
)
)
//'eventDisplay' => 'list' // only upcoming
), true ); ?>
<?php if( $proj_events->have_posts() ) :
$countposts = $proj_events->found_posts;
?>
<div class="row">
<h2 class="this-week">THIS WEEK</h2>
<?php while( $proj_events->have_posts() ) : $proj_events->the_post(); ?>
<div class="upcoming">
<div class="front-card small">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('thumbnail',array( 'class' => 'img-front' ));?>
</a>
<a href="<?php the_permalink(); ?>">
<div class="row front-date-row week">
<div class="col-md-12 front-date">
<div class="front-day">
<?php echo tribe_get_start_date(null, false, 'd');?>
</div>
<div class="front-month">
<?php echo tribe_get_start_date(null, false, 'M');?>
</div>
</div>
<div class="col-md-12 front-event-title ">
<?php echo substr(the_title($before = "", $after = "", FALSE),0, 15);?><br>
<span class="front-location">
<?php echo tribe_get_full_address(); ?>
</span>
</div>
</div>
</a>
</div>
</div>
<?php endwhile; ?>
</div>
<?php else: ?>
<div class="sorry">
<p>There are currently no upcoming events for the next seven days</p>
</div>
</div>
<?php endif; wp_reset_postdata(); ?>
</div>
</div>
</div>
</div>
<footer>
<p class="clearfix"><?php the_tags('<span class="tags">' . __("Tags","wpbootstrap") . ': ', ', ', '</span>'); ?></p>
</footer> <!-- end article footer -->
</article> <!-- end article -->
<?php comments_template(); ?>
<?php endwhile; ?>
<?php else : ?>
<article id="post-not-found">
<header>
<h1><?php _e("Not Found", "wpbootstrap"); ?></h1>
</header>
<section class="post_content">
<p><?php _e("Sorry, but the requested resource was not found on this site.", "wpbootstrap"); ?></p>
</section>
<footer>
</footer>
</article>
<?php endif; ?>
</div> <!-- end #main -->
<?php //get_sidebar(); // sidebar 1 ?>
</div> <!-- end #content -->
<?php get_footer(); ?>