i have a custom post type called 'electronics' with taxonomy categories called 'computers, phones, notebooks...and more'
in the taxonomy.php template, ive managed to get the taxonomy name, slug and id with this code.
<?php
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
echo $term->name; // will show the name
echo $term->slug; // will show the slug
echo $term->term_id; // will show the id
?>
so if im in the computers taxonomy page, i get 'Computers computers 11'
with either pf the values generated each time how can i generate the posts according to which 'taxonomy page' im in. eg. posts tagged with 'computers' in the computers taxonomy page, posts tagged with phones in the phone taxonomy page.. and so on.
like something likes this but for taxonomies...
<?php
$catquery = new WP_Query( 'cat=3' );
while($catquery->have_posts()) : $catquery->the_post();
?>
<ul>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
<ul><li><?php the_content(); ?></li>
</ul>
</li>
</ul>
<?php endwhile; ?>