This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate-agenda.php
85 lines (77 loc) · 1.87 KB
/
template-agenda.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
<?php
/*
Template Name: Agenda
*/
?>
<?php
$today = date("m/j/Y");
/** array com as configurações da query **/
$args = array(
'posts_per_page' => 10,
'post_type' => 'curso',
'meta_key' => 'wpcf-course_date',
'meta_value' => strtotime($today),
'meta_compare' => '>=',
'orderby' => 'meta_value',
'order' => 'ASC'
);
query_posts($args);
?>
<?php
$cont = 0;
while (have_posts()) : the_post();
$course_date = types_render_field("course_date", array("style" => "text", "format" => "j/m/Y"));
?>
<?php
//if (($c_dia >= date("j")) && ($c_mes >= date("m"))) {
$cont_aux = $cont;
$cont++;
?>
<?php
if (($cont == 1) || ($cont_aux % 3 == 0)){
echo "<div class='row'>";
}
?>
<article <?php post_class('col-sm-4'); ?>>
<div class="card-curso">
<header>
<a href="<?php the_permalink(); ?>">
<?php
$postid = get_the_ID();
echo get_the_post_thumbnail(
$postid,
'full',
array(
'class' => "img-responsive"
)
);
?>
</a>
</header>
<a href="<?php the_permalink(); ?>">
<h2 class="entry-title"><?php the_title(); ?></h2>
</a>
Próxima turma:
<span class="course-date">
<?php echo $course_date; ?>
</span>
<?php
if (types_render_field("cidade" , array( "output" => "raw" )) != ""){
echo "<span>".types_render_field("cidade", array( "output" => "raw" ))."</span>";
};
?>
</div>
</article>
<?php
if ($cont % 3 == 0){
echo "</div>";
}
?>
<?php
// }; //end if showing only next courses
?>
<?php
endwhile;
?>
</div>
<?php wp_reset_query(); ?>