Skip to content

Instantly share code, notes, and snippets.

@samikeijonen
Created November 10, 2013 11:36
Show Gist options
  • Save samikeijonen/7397144 to your computer and use it in GitHub Desktop.
Save samikeijonen/7397144 to your computer and use it in GitHub Desktop.
<?php
get_header(); // Loads the header.php template. ?>
<?php
if ( is_tax( 'post_format', 'post-format-video' ) ) {
if ( isset( $_GET['video_id'] ) ) {
$video_id = absint( $_GET['video_id'] );
} else {
$video_id = get_the_ID();
}
echo ( $video = hybrid_media_grabber( array( 'post_id' => $video_id, 'type' => 'video', 'split_media' => true, 'before' => '<div class="entry-media">', 'after' => '</div>' ) ) );
}
?>
<div id="content" <?php hybrid_attr( 'content' ); ?>>
<?php get_template_part( 'loop-meta' ); // Loads the loop-meta.php template. ?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="webdento-video-wrapper">
<article <?php hybrid_attr( 'post' ); ?>>
<div class="entry-summary">
<a href="?video_id=<?php echo get_the_ID(); ?>#main">
<?php if ( current_theme_supports( 'get-the-image' ) ) get_the_image( array( 'size' => 'webdento-thumbnail-smaller', 'link_to_post' => false, 'image_class' => 'webdento-thumbnail-image', 'width' => 240, 'height' => 135 ) ); ?>
</a>
</div><!-- .entry-summary -->
<header class="entry-header">
<?php the_title( '<h2 class="entry-title"><a href="?video_id=' . get_the_ID() . '#main">', '</a></h2>' ); ?>
</header><!-- .entry-header -->
</article><!-- .entry -->
</div><!-- .webdento-video-wrapper -->
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>
<?php endif; ?>
<?php get_template_part( 'loop-nav' ); // Loads the loop-nav.php template. ?>
</div><!-- #content -->
<?php get_footer(); // Loads the footer.php template. ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment