Your query should work if you call global $post
and don’t reset the query (not needed when using WP_Query).
You can also try using tax_query
.
$tax = 'issue';
$terms = get_terms( $tax );
foreach ( $terms as $term ) :
echo $term->name;
$args = array(
'post_type' => $post_type,
'post_per_page' => -1,
'post_status' => 'publish',
'caller_get_posts' => 1
'tax_query' => array(
array(
'taxonomy' => $tax,
'field' => 'ID',
'terms' => array( $term->term_id )
)
)
);
$my_query = new WP_Query($args); ?>
<ul class="<?php echo $term->slug; ?>">
<?php if( $my_query->have_posts() ) : ?>
<?php while ( $my_query->have_posts() ) : $my_query->the_post(); global $post; ?>
<li><a href="https://wordpress.stackexchange.com/questions/33064/<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a> by <?php echo get_post_meta($post->ID, 'author', true); ?></li>
<?php endwhile; endif; ?>
</ul>
<?php endforeach; ?>