-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-speaker.php
86 lines (65 loc) · 2.52 KB
/
single-speaker.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php get_header(); ?>
<?php get_template_part( 'parts/page-header-2col'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article" itemscope itemtype="http://schema.org/BlogPosting">
<section class="entry-content clearfix" itemprop="articleBody">
<div class="speaker-thumbnail">
<?php
if ( has_post_thumbnail() )
{
the_post_thumbnail('medium', array( 'class' => 'img-responsive alignleft' ));
}
?>
</div>
<h1>
<?php the_title(); ?>
<a class="button icon alignright" href="<?php echo get_field('link'); ?>" target="_blank">Website</a>
</h1>
<?php the_content(); ?>
<?php uu_sharebuttons(); ?>
<?php wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'uu2014' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
) ); ?>
<h2>Videos</h2>
<?php
// Hack to find videos for a speaker, found on http://support.advancedcustomfields.com/forums/topic/meta-query-for-post-object/
$args = array (
'category_name' => 'video',
'meta_query' => array(
array(
'key' => 'speakers',
'value' => '"' . get_the_ID() . '"',
'compare' => 'LIKE',
),
),
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) : ?>
<?php while ($query->have_posts()) : $query->the_post(); ?>
<?php get_template_part( 'parts/post-loop-video'); ?>
<?php endwhile; ?>
<?php get_template_part('includes/template','pager'); //wordpress template pager/pagination ?>
<?php else : ?>
<div class="no-videos">
<?php _e('No videos available', 'uu2014') ?>
</div>
<?php endif; ?>
</section><?php // end article section ?>
<footer class="article-footer">
</footer><?php // end article footer ?>
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() ) :
comments_template();
endif;
?>
</article><?php // end article ?>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part('includes/template','error'); // WordPress template error message ?>
<?php endif; ?>
<?php get_template_part( 'parts/page-footer-2col'); ?>
<?php get_footer(); ?>