-
Notifications
You must be signed in to change notification settings - Fork 1
/
page-proximas-sessoes.php
103 lines (82 loc) · 3.45 KB
/
page-proximas-sessoes.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
<?php
/*
Template Name: Proximas Sessões
*/
get_header(); ?>
<div class="section">
<div class="container">
<div class="row">
<h1>
Próximas Sessões
</h1>
<hr>
</div>
</div>
</div>
<div class="section">
<div class="container">
<div class="row">
<div class="col-md-12">
<ul class="media-list">
<?php
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'sessao',
'order' => 'DESC',
'orderby' => 'meta_value',
'meta_key' => 'ss_data',
'posts_per_page' => 10,
'paged' => $paged
);
$loop_sessoes = new WP_Query( $args );
while ( $loop_sessoes->have_posts() ) : $loop_sessoes->the_post();
$pdi = $post->ID;
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($pdi), 'full' );
$thumb_url = $thumb['0'];
if(empty($thumb_url)){
$thumb_url = wp_upload_dir()['baseurl']."/cineclube/sessao.png";
}
/**
** Get MetasBoxs
**/
$relato = rwmb_meta( 'ss_relato', 'type=text', $pdi );
$nome_ceu = rwmb_meta( 'ss_cineclube_nome', 'type=text', $pdi );
$cineclube_id = rwmb_meta( 'ss_cineclube_id', 'type=text', $pdi );
try{
$data = new DateTime( rwmb_meta( 'ss_data', 'type=text', $pdi ) );
$data = $data->format('d/m/Y');
}
catch (Exception $e){
$data = rwmb_meta( 'ss_data', 'type=text', $pdi );
}
$horario = rwmb_meta( 'ss_horario', 'type=text', $pdi );
?>
<li class="media">
<a class="pull-left" href="<?php echo the_permalink(); ?>"><img class="media-object" src="<?php echo $thumb_url ?>" height="64" width="64"></a>
<div class="media-body">
<h1 class="media-heading">
<a href="<?php echo the_permalink(); ?>"><?php echo get_the_title(); ?></a>
</h1>
<p class="bloco_cineclubes">
<a href="<?php echo get_permalink( $cineclube_id ); ?>"><b><?php echo $nome_ceu; ?></b></a>
</p>
<p class="bloco_cineclubes"><?php echo $data ?> - <?php echo $horario ?></p>
</div>
</li>
<hr>
<?php endwhile; wp_reset_query(); ?>
<hr>
</ul>
</div>
<div class="row">
<div class="col-md-12">
<?php
//PAGINATION
custom_pagination($loop_sessoes->max_num_pages,"",$paged);
?>
</div>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>