-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapasdevista-bubble.php
53 lines (44 loc) · 1.44 KB
/
mapasdevista-bubble.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
<div class="balloon-taxs" >
<?php
$post_ID = get_the_ID();
$querystr = "
SELECT $wpdb->terms.name FROM $wpdb->posts
INNER JOIN $wpdb->postmeta ON($wpdb->posts.ID = $wpdb->postmeta.post_id)
INNER JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id)
INNER JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
INNER JOIN $wpdb->terms ON($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id)
WHERE
$wpdb->posts.ID = $post_ID
AND $wpdb->posts.post_type = 'mapa'
AND $wpdb->postmeta.meta_key = '_mpv_inmap'
AND $wpdb->term_taxonomy.taxonomy NOT IN ( 'territorio', 'tipo', 'publicoalvo', 'tematico', 'identitario' )
GROUP BY $wpdb->terms.term_id
";
$terms = $wpdb->get_results($querystr, ARRAY_N);
$terms_str = "";
$terms_sep = ' / ';
foreach ($terms as $term)
{
if(is_array($term))
{
foreach ($term as $subterm)
{
$terms_str .= $terms_str != '' ? $terms_sep . $subterm : $subterm;
}
}
else
{
$terms_str .= $terms_str != '' ? $terms_sep . $subterm : $subterm;
}
}
?>
<span class="balloon-taxs-names"><strong>Áreas culturais: </strong><?php echo $terms_str;//implode(',', $terms); ?></span>
</div>
<div class="balloon-entry-default clearfix" >
<?php
$balloon_excerpt = get_the_excerpt();
if ( ! empty( $balloon_excerpt ) ) {
echo '<strong>Objetivos: </strong>' . $balloon_excerpt;
}
?>
</div>