-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapasdevista-loop-bubble.php
112 lines (110 loc) · 4.17 KB
/
mapasdevista-loop-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
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
104
105
106
107
108
109
110
111
112
<?php
if(array_key_exists('offset', $_POST))
{
$posts = mapasdevista_get_posts(1, $mapinfo, array('posts_per_page' => 500, 'offset' => $_POST['offset']));
if(!$posts->have_posts())
{
echo 0;
}
while($posts->have_posts()): $posts->the_post(); ?>
<div id="balloon_<?php the_ID(); ?>" class="result clearfix">
<div class="balloon clearfix">
<div class="content">
<header class="entry-header">
<h1 class="bottom entry-title"><a class="pontos-js-link-to-post" id="balloon-post-link-<?php the_ID(); ?>" href="<?php the_permalink(); ?>" onClick="pontos_linkToPost(this); return false;"><?php the_title(); ?></a></h1>
<div class="entry-meta">
<?php pontosdecultura_the_terms( 'tipo' ); ?>
<em>em</em>
<span class="balloon-state-city entry-term">
<?php
$uf = false;
$cidade = false;
$territorios = wp_get_post_terms(get_the_ID(), 'territorio');
foreach ($territorios as $territorio)
{
if($territorio->parent == 0) // Estado
{
$uf = $territorio->name;
}
else
{
$cidade = $territorio->name;
}
}
if($cidade)
{
?>
<span class="balloon-city"><?php echo $cidade; ?></span>
<?php
}
if($uf)
{
?>
<span class="balloon-sep">–</span> <span class="balloon-uf"><?php echo $uf; ?> </span>
<?php
}
?>
</span>
</div><!-- .entry-meta -->
</header>
<?php mapasdevista_get_template( 'mapasdevista-bubble', get_post_format() ); ?>
<a id="balloon-post-read-more-<?php the_ID(); ?>" href="<?php the_permalink(); ?>" onClick="pontos_linkToPost(this); return false;" class="read-more">Veja mais informações</a>
</div>
</div>
</div><!-- #balloon -->
<?php endwhile;
}
else
{?>
<div id="mapasdevista_load_bubbles" class="hide">
<?php $posts = mapasdevista_get_posts(1, $mapinfo);
while($posts->have_posts()): $posts->the_post(); ?>
<div id="balloon_<?php the_ID(); ?>" class="result clearfix">
<div class="balloon clearfix">
<div class="content">
<header class="entry-header">
<h1 class="bottom entry-title"><a class="pontos-js-link-to-post" id="balloon-post-link-<?php the_ID(); ?>" href="<?php the_permalink(); ?>" onClick="pontos_linkToPost(this); return false;"><?php the_title(); ?></a></h1>
<div class="entry-meta">
<?php pontosdecultura_the_terms( 'tipo' ); ?>
<em>em</em>
<span class="balloon-state-city entry-term">
<?php
$uf = false;
$cidade = false;
$territorios = wp_get_post_terms(get_the_ID(), 'territorio');
foreach ($territorios as $territorio)
{
if($territorio->parent == 0) // Estado
{
$uf = $territorio->name;
}
else
{
$cidade = $territorio->name;
}
}
if($cidade)
{
?>
<span class="balloon-city"><?php echo $cidade; ?></span>
<?php
}
if($uf)
{
?>
<span class="balloon-sep">–</span> <span class="balloon-uf"><?php echo $uf; ?> </span>
<?php
}
?>
</span>
</div><!-- .entry-meta -->
</header>
<?php mapasdevista_get_template( 'mapasdevista-bubble', get_post_format() ); ?>
<a id="balloon-post-read-more-<?php the_ID(); ?>" href="<?php the_permalink(); ?>" onClick="pontos_linkToPost(this); return false;" class="read-more">Veja mais informações</a>
</div>
</div>
</div><!-- #balloon -->
<?php endwhile;?>
</div><!-- #mapasdevista_load_bubbles -->
<?php
}