<?php if (!($url = ($i = get_post_meta($post->ID, 'video', true)) ? $i['url'] : null)) { return; } $url = parse_url(esc_url($url)); $sizes = array('youtube' => is_retro_post_type() ? array(700, 394) : array(853, 480), 'vimeo' => is_retro_post_type() ? array(700, 394) : array(960, 540)); ?> <figure class="featured video"> <?php if (strpos($url['host'], 'youtube.com') !== false || $url['host'] == 'youtu.be') { ?> <!-- youtube --> <iframe width="<?php esc_attr_e($sizes['youtube'][0]); ?> " height="<?php esc_attr_e($sizes['youtube'][1]); ?> " src="http://www.youtube.com/embed/<?php esc_attr_e(isset($url['query']) ? str_replace('v=', null, str_replace('&', null, $url['query'])) : str_replace('/', null, $url['path'])); ?> ?rel=0" frameborder="0" allowfullscreen></iframe> <?php } elseif (strpos($url['host'], 'vimeo.com') !== false) { ?>
<?php get_header(); ?> <?php get_template_part('nav'); ?> <?php while (have_posts()) { ?> <?php the_post(); ?> <?php get_template_part('view', is_retro_post_type() ? 'item' : 'article'); ?> <?php } ?> <?php get_footer();
<figure class="featured gallery"> <?php the_post_thumbnail('retro-big'); ?> <ul class="gallery-list clear <?php esc_attr_e(is_retro_post_type() ? 'half' : ''); ?> "> <?php foreach ($images as $id) { ?> <li> <img src="<?php echo reset(wp_get_attachment_image_src($id, is_retro_post_type() ? 'retro-big' : null)); ?> " alt="" /> </li> <?php } ?> </ul> </figure>
<?php if (!has_post_thumbnail()) { return; } ?> <figure class="featured standard"> <?php the_post_thumbnail(is_retro_post_type() ? 'retro-big' : null); ?> </figure>
function retro_get_headline($post) { if ($id = isset($post->ID) ? $post->ID : (is_numeric($post) ? $post : null)) { $meta = get_post_meta($id, 'headline', true); if (isset($meta['headline'])) { $headline = $meta['headline']; } } else { if (is_retro_post_type()) { $meta = get_post_meta(get_retro_post_type_page(), 'headline', true); if (isset($meta['headline'])) { $headline = $meta['headline']; } } } return $headline; }