/
fun-page.php
61 lines (54 loc) · 1.47 KB
/
fun-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
<?php
/**
* Template Name: Front Page
* The template for displaying something RVArts related on 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 _tk
* @package TribeEventsCalendar
*/
get_header(); ?>
<?php
$args = array(
'post_status'=>'publish',
'post_type'=>array(Tribe__Events__Main::POSTTYPE),
'posts_per_page'=>10,
//order by startdate from newest to oldest
'meta_key'=>'_EventStartDate',
'orderby'=>'_EventStartDate',
'order'=>'DESC',
//required in 3.x
'eventDisplay'=>'custom',
//query events by category
// 'tax_query' => array(
// array(
// 'taxonomy' => 'tribe_events_cat',
// 'field' => 'slug',
// 'terms' => 'featured',
// 'operator' => 'IN'
// ),
// )
);
$get_posts = null;
$get_posts = new WP_Query();
$get_posts->query($args);
if($get_posts->have_posts()) : while($get_posts->have_posts()) : $get_posts->the_post(); ?>
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a><br />
<?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?>
<?php echo tribe_get_start_date(); ?> - <?php echo tribe_get_end_date(); ?>
<?php } else { ?>
<?php echo tribe_get_start_date(); ?>
<?php } ?>
<?php the_content(); ?>
<?php
endwhile;
endif;
wp_reset_postdata();
?>
<?php get_footer(); ?>