-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsingle-post.php
62 lines (62 loc) · 2.04 KB
/
single-post.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
<?php
global $post;
require_once(get_template_directory() . '/api/routes/search/search-helpers.php');
while( have_posts() ){
the_post();
$search = sanitize_text_field($_GET['search']);
?>
<article class="blog-singlePost">
<header class="contentHeader contentHeader--archive">
<?php $title = highlight_term( $post->post_title, $search); ?>
<h2><?= apply_filters('the_title', $title); ?></h2>
<div class="blog-meta">Posted <?php the_date(); ?></div>
</header>
<aside class="researchMenu">
<button class="researchMenu-toggle">
Expand Menu <?= icon( 'down', 'link' ); ?>
</button>
<?php if(!get_field('hide_sidebar')): ?>
<form class="researchMenu-search" method="get" action="<?php bloginfo('url'); ?>/">
<input name="s" type="text" placeholder="Search blog">
<input name="type" value="blog" type="hidden">
<button type="submit"><?= icon( 'search' ); ?></button>
</form>
<?php dynamic_sidebar('posts'); ?>
<?php endif; ?>
</aside>
<section class="blog-content">
<?php $content = highlight_term( $post->post_content, $search); ?>
<?= apply_filters('the_content', $content); ?>
<?php if(get_the_category_list()): ?>
<div class="blog-category">
Posted in <?= get_the_category_list(); ?>
</div>
<?php endif; ?>
<?php if(get_the_tag_list()): ?>
<div class="blog-category">
Tagged <?= get_the_tag_list(); ?>
</div>
<?php endif; ?>
<?php
$authors = get_field('authors');
if(have_rows('authors')):
while(have_rows('authors')):
the_row();
?>
<div class="author">
<div class="author-thumbnail">
<img src="<?= the_sub_field('avatar'); ?>" />
</div>
<div class="author-bio">
<strong><?= the_sub_field('name'); ?></strong>
<p><?= the_sub_field('bio'); ?></p>
</div>
</div>
<?php
endwhile;
endif;
?>
</section>
</article>
<?php
}