-
Notifications
You must be signed in to change notification settings - Fork 3
/
search.php
66 lines (53 loc) · 1.99 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
<?php
/**
* The template for displaying search results pages.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
*
* @package Triangle_X
*/
get_header(); ?>
<div class="generic-wrapper">
<?php insert_ad('Global Banner Top', 'banner-top'); ?>
<div class="category-title">
<h1 class="text-title-large"><?php printf(esc_html__( 'Search Results for: %s', 'triangle-x' ), '<span>' . get_search_query() . '</span>'); ?></h1>
</div>
<div class="generic-flex-container">
<main class="flex-main">
<?php
if(have_posts())
{
while(have_posts())
{
the_post();
$link = get_the_permalink();
echo '<div class="category-post">';
// Left box - date
printf('<div class="category-date">%1$s</div>', get_the_date('M. j, Y'));
// Middle box flex - headline, author, and excerpt
echo '<div class="category-post-info">';
printf('<a class="text-headline-medium" href="%1$s">%2$s</a>', $link, get_the_title());
printf('<div class="category-tease">%1$s</div>', get_the_excerpt());
printf('<div class="category-author">By %1$s</div>', coauthors_posts_links(null, null, null, null, false));
echo '</div>';
// Right box - thumbnail
printf('<a href="%1$s"><div class="category-thumbnail">%2$s</div></a>', $link, get_the_post_thumbnail(null, array('class' => '169-preview-medium')));
echo '</div>';
}
}
else
get_template_part('template-parts/content', 'none');
?>
<div class="category-pagination">
<?php posts_nav_link(' ','<< Newer Stories','Older Stories >>'); ?>
</div>
</main>
<aside class="flex-sidebar">
<?php insert_ad('Global Medium Rectangle Top', 'medium-rectangle'); ?>
<?php dynamic_sidebar('sidebar-global'); ?>
<?php insert_ad('Global Medium Rectangle Bottom', 'medium-rectangle');?>
</aside>
</div>
<?php insert_ad('Global Banner Bottom', 'banner-bottom'); ?>
</div>
<?php get_footer(); ?>