/
search.php
239 lines (187 loc) · 8.6 KB
/
search.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<?php
get_header();
global $plandd_option;
global $post;
global $wp_query;
$obj = get_queried_object();
$layout = $plandd_option['temp-blog-list-layout']['topo'];
if ($layout): foreach ($layout as $key=>$value) {
switch($key) {
case 'painel': require get_template_directory()."/includes/componentes/painel.php";
break;
case 'cadastro': require get_template_directory()."/includes/componentes/cadastro.php";
break;
case 'blog': require get_template_directory()."/includes/componentes/blog.php";
break;
case 'galeria': require get_template_directory()."/includes/componentes/galeria.php";
break;
case 'instagram-hash': require get_template_directory()."/includes/componentes/instagram.hashtag.php";
break;
case 'instagram-perfil': require get_template_directory()."/includes/componentes/instagram.perfil.php";
break;
case 'geolocalizacao': require get_template_directory()."/includes/componentes/geolocalizacao.php";
break;
case 'cabecalho': require get_template_directory()."/includes/componentes/cabecalho.php";
break;
case 'rodape': require get_template_directory()."/includes/componentes/rodape.php";
break;
}
}
endif;
?>
<?php
/**
* Cabeçalho
*/
$bg_header = $plandd_option['temp-blog-ele-header']['url'];
$desc = $plandd_option['temp-blog-ele-header-txt'];
?>
<header id="blog-header" class="small-12 left rel" data-thumb="<?php echo $bg_header; ?>">
<div class="blog-header-mask small-12 full-height abs left-axy"></div>
<div class="row">
<div class="small-12 columns d-table rel">
<div class="small-12 d-table-cell text-center">
<h1 class="blog-font">BLOG</h1>
<?php
if(!empty($desc))
echo '<h5 class="blog-font">'. $desc .'</h5>';
?>
</div>
</div>
</div>
</header>
<?php
$date_icon = $plandd_option['temp-bloglist-date-icon']['url'];
$comments_icon = $plandd_option['temp-bloglist-comments-icon']['url'];
?>
<section id="blog-section" class="small-12 left section-block">
<div class="row">
<nav id="blog-list" class="small-12 large-8 columns">
<header class="divide-30 left">
<p class="no-margin">Você pesquisou por <strong><?php echo esc_html( get_search_query( false ) ); ?></strong>. Foram encontrado <?php echo $wp_query->found_posts; ?> resultados.</p>
</header>
<?php
if (have_posts()) : while (have_posts()) : the_post();
global $post;
$comments_count = wp_count_comments();
?>
<article class="post-item divide-30">
<time class="small-12 left post-date text-center" pubdate>
<img src="<?php echo $date_icon; ?>" alt="">
<span><?php echo the_time('d \d\e F, Y'); ?></span>
</time>
<h2 class="divide-20 text-center">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="blog-title"><?php the_title(); ?></a>
</h2>
<nav class="share-footer show-for-large-up text-center">
<ul class="inline-list d-iblock no-margin">
<li><div class="fb-like" data-layout="button_count" data-href="<?php the_permalink(); ?>"></div></li>
<li><a class="twitter-share-button" href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>">Tweet</a></li>
<li><div class="g-plusone" data-size="medium" data-width="65" data-href="<?php the_permalink();?>"></div></li>
<li><div class="fb-share-button" data-href="<?php the_permalink(); ?>" data-layout="button"></div></li>
</ul>
<div class="divide-20"></div>
</nav>
<figure class="divide-20 post-th">
<?php
$thumb = getThumbUrl('large',$post->ID);
$video = get_field('post_video');
$link = get_permalink($post->ID);
if(!empty($thumb) || !empty($video)) {
if(!empty($video))
echo '<div class="flex-video no-margin">' . $video . '</div>';
else
echo "<a href=\"{$link}\"><img src=\"{$thumb}\" class=\"small-12 left\"></a>";
}
?>
</figure>
<h5 class="divide-20 d-block post-author text-center text-up">Por: <?php echo the_author_meta( 'first_name' ); ?></h5>
<?php
if(get_the_tags()):
?>
<nav class="post-tags text-center">
<ul class="inline-list d-iblock">
<?php
$posttags = get_the_tags();
foreach ($posttags as $tag) {
$tag_link = get_tag_link($tag->term_id);
echo '<li><a href="'. $tag_link .'">'. $tag->name .'</a></li>';
}
?>
</ul>
</nav>
<?php
endif;
?>
<p class="post-excerpt divide-30 text-center show-for-large-up"><?php the_excerpt(); ?></p>
<p class="left no-margin">
<a href="<?php the_permalink(); ?>#disqus_thread" title="Comentários" class="post-comments text-up">
<?php
if(!empty($comments_icon))
echo '<img src="'. $comments_icon .'" alt="" style="margin-right:5px;">';
?>
<span><?php comments_number( 'Sem comentários', '1 comentário', '% comentários' ); ?></span>
</a>
</p>
<p class="right no-margin">
<a href="<?php the_permalink(); ?>" title="Continuar lendo" class="post-read text-up">Continuar lendo <i class="icon-chevron-thin-right"></i></a>
</p>
</article>
<?php endwhile; endif; ?>
</nav>
<?php
/**
* Sidebar
*/
require get_template_directory()."/templates/blog_sidebar.php";
?>
<footer id="nav-below" class="small-12 left text-center hide">
<div class="divide-20"></div>
<?php
global $wp_query;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'next_text' => '»',
'prev_text' => '«',
'type' => 'list',
) );
?>
</footer>
</div>
</section>
<?php
/**
* newsletter
*/
require get_template_directory()."/templates/newsletter.php";
//-----------------------------------------------------------
$layout = $plandd_option['temp-blog-list-layout']['rodape'];
if ($layout): foreach ($layout as $key=>$value) {
switch($key) {
case 'painel': require get_template_directory()."/includes/componentes/painel.php";
break;
case 'cadastro': require get_template_directory()."/includes/componentes/cadastro.php";
break;
case 'blog': require get_template_directory()."/includes/componentes/blog.php";
break;
case 'galeria': require get_template_directory()."/includes/componentes/galeria.php";
break;
case 'instagram-hash': require get_template_directory()."/includes/componentes/instagram.hashtag.php";
break;
case 'instagram-perfil': require get_template_directory()."/includes/componentes/instagram.perfil.php";
break;
case 'geolocalizacao': require get_template_directory()."/includes/componentes/geolocalizacao.php";
break;
case 'cabecalho': require get_template_directory()."/includes/componentes/cabecalho.php";
break;
case 'rodape': require get_template_directory()."/includes/componentes/rodape.php";
break;
}
}
endif;
get_footer();
?>