Thanks for the answer, but it’s not the code i want.
I’d like to show only the 6 posts in the cat id 2 and 6, and to be equal posts: 3in id:2 and 3in id:6.
in the code below it show the 6 (img) posts randomly, but not equals with cats id 2&6!!! how can i do it, with only one loop.
<ul>
<?php query_posts('cat=2,6&orderby=rand&showposts=6'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php //call the custom field "image1" //
$var_img01 = get_post_meta($post->ID, "image1", TRUE);?>
<li>
<?php // Insert the custom field "image1" //
if ( $var_img01 ) { ?>
<a href="<?php the_permalink() ?>">
<img src="<?php echo $var_img01; ?>"/>
</a>
<?php } else { ?>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/no-image.jpg"/>
<?php } ?>
</li>
<?php endwhile; else: ?>
Oops, there is no pruduct in this page!!!
<?php endif; ?>
</ul>
Thanks