-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsearch.php
More file actions
75 lines (60 loc) · 1.91 KB
/
search.php
File metadata and controls
75 lines (60 loc) · 1.91 KB
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
<?php
get_header();
?>
<div class="container-blog">
<section class="container-inicial-blog">
<h1>Exibindo resultados para "<?php echo get_search_query(); ?>"</h1>
</section>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
if (have_posts()) :
if ($paged == 1) :
the_post();
?>
<a href="<?php the_permalink(); ?>" class="conteiner-destaque">
<?php get_template_part('template-parts/content', 'featured'); ?>
</a>
<?php
endif;
rewind_posts();
?>
<section class="conteiner-conteudos">
<?php
$post_count = 0;
while (have_posts()) : the_post();
if ($paged == 1 && $post_count == 0) :
$post_count++;
continue;
endif;
?>
<a href="<?php the_permalink(); ?>" class="painel-blogs">
<?php get_template_part('template-parts/content', 'archive'); ?>
</a>
<?php
$post_count++;
endwhile;
?>
</section>
<?php
the_posts_pagination(array(
'mid_size' => 2,
'prev_text' => __('« Anterior', 'textdomain'),
'next_text' => __('Próximo »', 'textdomain'),
));
else :
?>
<div class="content">
<p>
<?php _e('Nenhum resultado encontrado. Tente fazer outra busca ou considere dar uma olhada em', 'textdomain'); ?>
<a href="<?php echo esc_url(get_permalink(get_option('page_for_posts'))); ?>">
<?php _e('nossos posts mais recentes', 'textdomain'); ?>
</a>.
</p>
</div>
<?php
endif;
?>
</div>
<?php
get_footer();
?>