Hello and thanks for this excellent plugin!
YARPP was working fine until I upgraded to version 3.2, which made my custom template for it to stop working (the default templates work normally). When I'm using my custom template it just shows the "Related Posts" title and nothing else loads below that, not even comments or the footer.
I can't figure out what the problem may be, so I would appreciate if someone could give it a look... Here's the code:
<h4 class="meta">Related Posts:</h4>
<?php if ($related_query->have_posts()):?>
<div class="related-posts">
<?php
$rp_ppr = 3; // Posts per row
$rpcounter = 1 // Loop counter
?>
<?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
<?php if ($rpcounter % $rp_ppr == 1) : ?>
<ul><?php endif ?>
<li<?php if ($rpcounter % $rp_ppr == 0) : ?> class="last"<?php endif ?>>
<a>" rel="bookmark">
<?php $id =$post->ID;
$the_content =$wpdb->get_var("SELECT post_content FROM $wpdb->posts WHERE ID = $id");
$pattern = '!<img.*?src="(.*?)"!';
preg_match_all($pattern, $the_content, $matches);
$firstimage_src = $matches['1'][0]; ?>
<?php if($firstimage_src != '') : ?>
<img src="/wp-content/uploads/phpthumb/phpThumb.php?src=<?=urlencode(catch_first_image())?>&w=160&h=90&zc=1&q=100" alt="<?php the_title(); ?>" />
<?php else : ?>
<img src="http://www.mysitehere.com/wp-content/themes/mytheme/images/default-related-thumbnail.jpg" alt="<?php the_title(); ?>" alt="" />
<?php endif; ?>
<?php the_title(); ?></a>
<?php if ( ($rpcounter % $rp_ppr == 0) || $rpcounter == $related_query->post_count) : ?></ul>
<?php endif ?>
<?php $rpcounter++ ?>
<?php endwhile; ?>
</div>
<?php else: ?>
<p>No Related Posts</p>
<?php endif; ?>
Thanks in advance!