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 the following query along with a custom post type called "Questions":

 <ul>
     <?php 
     $args = array( 
        'post_type' => 'questions', 
        'posts_per_page' => 50 
     );

     $loop = new WP_Query( $args ); 

     while ( $loop->have_posts() ) : $loop->the_post(); ?>
         <li>
            <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
                <?php the_title(); ?>
            </a>
         </li>
     <?php 
     endwhile; ?>
 </ul>

I've also created a custom taxonomy called "Type" and linked it to this post type in order to categorize the content (like, type of questions). This query lists all the questions title but I would like to find a way to list the categories this question belongs to so it looks like:

  1. How do I configure my email client? in "Technical Support"
  2. How to change my themes' background image in "Wordpress Support"

I've tried using but I'm not getting any results.

Any ideas?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Category is a specific taxonomy built into WordPress, the_category only works with this single taxonomy, not custom taxonomies. To fetch terms from a custom taxonomy, use the_terms:

the_terms( $post->ID, 'type' );
share|improve this answer

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.