forked from GSA/datagov-wptheme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle-impact.php
70 lines (57 loc) · 2.31 KB
/
single-impact.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
<?php include('category-subnav.php'); ?>
<?php
$thumbnail = $agency_name = $contact_email_url = $dataset_url = false;
if (function_exists('get_field')) {
$thumbnail = get_field('thumbnail');
$agency_name = get_field('agency_name');
$contact_email_url = get_field('contact_email_url');
$dataset_url = get_field('dataset_url');
}
?>
<div class="wrap container content-page">
<?php while (have_posts()) : the_post(); ?>
<?php if (has_category() && ($categ = get_the_category()) && ($categ[0]->slug !== 'uncategorized')): ?>
<h1 class="page-title">
<?php the_title(); ?>
</h1>
<?php endif; ?>
<div class="content impact-full">
<div class="row"><a class="btn btn-primary pull-right" role="button" href="<?php echo get_home_url(); ?>/stories">Back to Stories</a></div>
<div class="col-md-6 col-lg-6">
<?php if ($thumbnail): ?>
<img class="thumbnail" src="<?php echo $thumbnail ?>" alt="<?php the_title(); ?>"/>
<?php endif ?>
</div>
<div class="col-md-6 col-lg-6">
<?php if ($agency = get_field("agency_name")): ?>
<p class="show-on-modal">
<strong>Agency:</strong>
<em><?php echo esc_html($agency); ?></em>
</p>
<?php endif; ?>
<?php if ($contact = get_field("contact_email_url")): ?>
<p class="show-on-modal">
<strong>Contact:</strong>
<?php if (is_email($contact)): ?>
<a
href="mailto:<?php echo sanitize_email($contact) ?>?subject=data.gov Impact: <?php the_title() ?>">
<?php echo sanitize_email($contact) ?>
</a>
<?php else: ?>
<a target="_blank" href="<?php echo esc_url($contact) ?>"><?php echo esc_url($contact) ?></a>
<?php endif; ?>
</p>
<?php endif; ?>
<?php if ($dataset_url = get_field("dataset_url")): ?>
<p class="show-on-modal">
<strong>Dataset:</strong>
<a target="_blank"
href="<?php echo esc_url($dataset_url); ?>"><?php echo esc_url($dataset_url); ?></a>
</p>
<?php endif; ?>
<?php the_content(); ?>
</div>
</div>
<?php wp_link_pages(array('before' => '<nav class="pagination">', 'after' => '</nav>')); ?>
<?php endwhile; ?>
</div>