Skip to content

Instantly share code, notes, and snippets.

@billerickson
Forked from lorinrivers/taxonomy-type.php
Created February 28, 2012 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/1928816 to your computer and use it in GitHub Desktop.
Save billerickson/1928816 to your computer and use it in GitHub Desktop.
taxonomy type
<?php
remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'do_film_loop');
function do_film_loop(){
$video_file_args = array(
'post_type' => 'film',
'order_by' => 'title',
'order' => 'ASC',
'posts_per_page' => '-1',
'tax_query' => array(
array(
'taxonomy' => 'type',
'field' => 'slug',
'terms' => $term
)
)
);
$video_file_query = new WP_Query($video_file_args);
?>
<div id="video_container">
<?php while($video_file_query->have_posts()) : $video_file_query->the_post();
$i = $i + 1;
$video_id = "video_" . $i ?>
<video id="<?php echo $video_id;?>" class="video-js vjs-default-skin" width="720" height="405" poster="<?php echo genesis_get_custom_field('_lr_video_poster'); ?>" controls preload="none">
<source src="<?php echo genesis_get_custom_field('_lr_video_file'); ?>" type="video/mp4" />
</video>
<?php endwhile; ?>
</div>
<ul id="thumbs">
<?php
$i = $i + 1;
$thumb_id = "thumb_" . $i;
while($video_file_query->have_posts()) : $video_file_query->the_post();
$i = $i + 1;
$thumb_id = "thumb_" . $i;
?>
<li id="<php echo $thumb_id; ?>"></li>
<?php endwhile; ?>
</ul>
<?php wp_reset_query();
}
genesis();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment