I'm currently developing a video interview section of a website. The client has asked that I list related video post titles and thumbnails by category and date range. The date range is the tricky part.
They way I have it currently setup is that underneath the video player, there is a list of 12 of the latest videos. The client specifically wants this to be changed -- he wants them sorted by date. So for example, if a video was posted on February 20, 2009, he wants 12 previously posted videos before February 20 to display, instead of just the latest.
Live Example:
http://michaelfairmansoaps.com/2009/video-interviews/arianne-zuker-a-day-of-days/
HTML/PHP code:
<?php
/*
Single Post Template: Video Interview
Description: Template for Video Interviews
*/
get_header();
?>
<div id="vid-interviews">
<div id="content-wrap" class="clearfix">
<div id="content">
<h3 class="single-vid-interviews">Video Interviews</h3>
<p class="all"><a href="/video-interviews/">« Back to all video interviews</a></p>
<div id="masthead-videos">
<div class="info">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<div class="entry">
<h2>
<?php the_title(); ?>
</h2>
<?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<?php wp_related_posts(); ?>
<p><a href="<?php the_permalink() ?>#respond">
<?php comments_number('0','1','%'); ?>
comments</a> on this interview</p>
<p>
<?php if (function_exists('sharethis_button')) { sharethis_button(); } ?>
</p>
</div>
</div>
</div>
</div>
<div id="wrap">
<div class="more-vids">
<h3>Latest Interviews</h3>
<ul>
<?php $recent = new WP_Query("cat=156&showposts=16"); while($recent->have_posts()) : $recent->the_post();?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" ><img src="<?php echo p75GetThumbnail($post->ID, 200, 133); ?>" alt="<?php the_title(); ?>" /><span>
<?php the_time('F j, Y') ?>
</span>
<?php the_title(); ?>
</a></li>
<?php endwhile; ?>
</ul>
<p class="more"><a href="/video-interviews/">« Back to all video interviews</a></p>
</div>
<div class="center" style="width:580px;">
<?php comments_template(); ?>
</div>
</div>
</div>
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
</div>
</div>
<?php get_footer(); ?>
I've looked around for a plugin but couldn't find a suitable solution. I'm hoping someone can help me out with this.