-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaxonomy-cat_viagem.php
100 lines (80 loc) · 2.01 KB
/
taxonomy-cat_viagem.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
<?php
/**
* Template Name: Viagens
*
*
*
*/
get_header();
get_sidebar();
$odin_general_opts = get_option( 'config' );
$imagem = $odin_general_opts['bgimg'];
$imagem = wp_get_attachment_image_src( $imagem, 'full' );
$obj = get_post_type_object( 'viagens' );
?>
<div id="primary" class="col-sm-10">
<div id="content" class="site-content" role="main">
<div class="clearfix"></div>
<h1 id="titulo-cpt" class="entry-header">
<?php echo $obj->name." - ".get_queried_object()->name;?>
</h1>
<div class="col-sm-1"></div>
<div id="descricao" class="col-sm-10">
<p><?php echo $obj->description;?></p>
</div>
<div class="clearfix"></div>
<div class="col-sm-1"></div>
<div class="clearfix"></div>
<div class="col-sm-1"></div>
<?php
$args = array(
'post_type' => 'viagens',
'posts_per_page' => 99999,
'paged' => true,
'tax_query' => array(
array(
'taxonomy' => 'cat_viagem',
'field' => 'slug',
'terms' => get_queried_object()->slug,
),
),
);
$viagens_query = new WP_Query( $args );
// The Loop
if ( $viagens_query->have_posts() ) {
echo '<ul id="conteudo-filtro" class="sem-margem col-sm-10"> ';
$count=1;
while ( $viagens_query->have_posts() ) {
$viagens_query->the_post();
$titu = get_the_title();
$desc = get_the_content();
?>
<li class='viagem col-sm-12 ' id="cliente-<?php echo $post->ID;?>">
<a href="<?php the_permalink();?>">
<div class=" thumb_viagem">
<?php
the_post_thumbnail('viagens');
?>
</div>
<div class="viagem_div">
<?php
echo '<h4>'.$titu.'</h4>';
echo the_excerpt();
?>
</div>
</a>
</li>
<div class="clearfix"></div>
<?php
$count++;
}//while
echo '</ul>';
} else {
// no posts found
}
?>
</div><!-- #content -->
</div><!-- #primary -->
<?php
get_footer();
?>