-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle-sites.php
64 lines (58 loc) · 1.76 KB
/
single-sites.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
<?php
/**
* The Template for displaying all single site posts.
*/
get_header(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<section id="intro-preview">
<div class="main-img-preview">
<div class="browser-bar">
<div class="browser-button"></div>
<div class="browser-button"></div>
<div class="browser-button"></div>
</div>
<div class="slide">
<?php if ( has_post_thumbnail() ) { ?>
<?php the_post_thumbnail('large'); ?>
<?php } ?>
<div class="designs-template-info">
<div class="button--centered">
<?php $url = get_post_meta($post->ID, 'url', $single = true); ?>
<a href="<?php echo $url; ?>" class="button designs-details-demo" data-text="Visit site">Visit site</a>
</div>
</div>
</div>
</div>
</section>
<main class="has-padding">
<div class="content container">
<div class="date"><?php $postDate = get_the_date('U'); echo timespan($postDate) ?></div>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php
$taxonomy = 'site_category';
$terms = get_the_terms( $post->ID, $taxonomy );
if (!empty( $terms )) {
echo '<div class="sitecats">Categories: ';
foreach($terms as $term) {
echo '<a class="cat-filter" href="'.get_term_link($term->slug, $taxonomy).'">'.$term->name.'</a>';
}
echo '</div>';
}
?>
<?php
$taxonomy = 'site_tag';
$terms = get_the_terms( $post->ID, $taxonomy );
if (!empty( $terms )) {
echo '<div class="sitetags">tags: ';
foreach($terms as $term) {
echo '<a class="cat-filter" href="'.get_term_link($term->slug, $taxonomy).'">'.$term->name.'</a>';
}
echo '</div>';
}
?>
</div>
</main>
<?php wpv_content_nav('nav-below'); ?>
<?php endwhile; // end of the loop. ?>
<?php get_footer(); ?>