I am using this code to load related posts with a custom taxonomy term slug:
<?php
global $post;
$terms = get_the_terms( $post->ID , 'topics', 'string');
$do_not_duplicate[] = $post->ID;
if(!empty($terms)){
foreach ($terms as $term) {
query_posts( array(
'topics' => $term->slug,
'showposts' => 4,
'caller_get_posts' => 1,
'post__not_in' => $do_not_duplicate ) );
if(have_posts()){
while ( have_posts() ) : the_post(); $do_not_duplicate[] = $post->ID; ?>
But I always get more than 4 posts. How can I really set this query to just 4 posts?
Thanks!
AD