Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a custom taxonomy 'where' and I am using this code to get taxonomy terms on single.php

<?php echo get_the_term_list( $post->ID, 'where', 'Where: ', ', ', '' ); ?>

How can I customize this code in a way if user click on 'where' terms, they should get posts of this taxonomy only from the current category.

share|improve this question
add comment

1 Answer

Use a taxonomy.php template?!

taxonomy.php

<?php get_header(); ?>

<?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?>

<h1><?php echo $term->name; ?></h1>

<?php
global $query_string;
query_posts( $query_string . '&orderby=title&order=asc' );

if (have_posts()) : 
?>

<?php
while (have_posts()) : the_post();
?>

<h1><a href="<?php echo get_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>

<?php endwhile; 
wp_reset_query();
?>

<?php endif; ?>

<?php get_footer(); ?>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.