It work, thank you.
i'd like to share my code if any one wanna it,
<ul class="gallery-more">
<?php
//get all posts for children of category $cata
$cata = 3;
$taxonomy = 'category';
$cata_children = get_term_children( $cata, $taxonomy );
$args=array(
'category__in' => $cata_children,
'post_status' => 'publish',
'posts_per_page' => -1,
'showposts'=>8,
'orderby'=>rand,
'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo 'List of Posts belonging to This Category';
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php // call the custom field key "exemple_image1" //
$var_img01 = get_post_meta($post->ID, "exemple_image1", TRUE);?>
<li>
<?php // Capture the custom field "image 1" //
if ( $var_img01 ) { ?>
<a title="Read more about : <?php the_title(); ?>" href="<?php the_permalink() ?>">
<img alt="<?php the_title(); ?>" src="<?php echo $var_img01; ?>"/>
</a>
<?php } else { ?>
<img src="<?php bloginfo('stylesheet_directory'); ?>/img/no-img.jpg" title="No image" width="100" height="100"/>
<?php } ?>
<div class="bg"/>
</li>
<?php endwhile; }
wp_reset_query(); // Restore global post data stomped by the_post().
?>
</ul>
The idea her, is to create a personal gallery of a products.
Enjoy.