-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnoticias-search.php
More file actions
55 lines (50 loc) · 1.95 KB
/
noticias-search.php
File metadata and controls
55 lines (50 loc) · 1.95 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
<?php get_header(); ?>
<main>
<section class="bg-news" id="search-field">
<div class="container d-flex justify-content-center">
<?php includeFile('components/search-input/index.php', array(
'search_page' => 'noticias'
))?>
</div>
</section>
<section class="container mb-3" id="list-news">
<div class="row gx-3 gy-3">
<?php
$s=get_search_query();
$args = array(
's' => $s,
'post_type' => 'noticia',
);
$query = new WP_Query( $args );
while ( $query -> have_posts()) : $query-> the_post();
?>
<div class="col-12 col-lg-4">
<?php includeFile('components/card-news/index.php', array(
'image' => get_the_post_thumbnail_url(),
'title' => get_the_title(),
'subtitle' => get_the_content(),
'url' => get_the_permalink()
)) ?>
</div>
<?php endwhile; ?>
</div>
</section>
<nav class="pagination d-flex justify-content-center w-100 mb-4">
<div class="pagination-wrapper d-flex justify-content-around">
<?php
$url = get_home_url($post->ID) . '/resultados-da-busca/?results=' . $queryPrograma . '%5D%5B' . $queryDestino;
$big = 999999999;
$pagination_args = array(
'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
'format' => '?paged=%#%',
'current' => max(1, get_query_var('paged')),
'total' => $busca_query->max_num_pages,
'prev_text' => '<',
'next_text' => '>'
);
echo paginate_links( $pagination_args );
?>
</div>
</nav>
</main>
<?php get_footer(); ?>