i’ve done trying with this code from this forum but it’s the same, double post.
<?php
//for a given post type, return all
$tax = 'product';
$terms = get_terms($tax);
if ($terms) {
foreach ($terms as $term) {
$args=array(
'post_type' => 'project',
//'$tax' => $tax_term->slug,
'$tax' => $tax_term->slug,
'post_status' => 'publish',
'posts_per_page' => 20,
'caller_get_posts'=> -1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo 'List of '.$post_type . ' where the taxonomy '. $tax . ' is '. $tax_term->name;
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php echo get_term_link($term->slug, 'product'); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
}
wp_reset_query();
}
}
?>
Thanks