Displaying custom posts by category

Can you be more specific?do you mean custom post type or custom query?

AFAIK when using custom post type you cannot directly use category_name since your post are treated in different way. You have to add custom taxonomies in register_post_type and then register them with register_taxonomy()

note: please correct me if my statement above is wrong, I’m not go deep with custom post type, at least for now.

say you have custom post type named portfolio, custom taxonomy named toolkit with following categories:

  1. preparation
  2. assessment
  3. leadership
  4. innovation

and you want to show all post in preparation:


beware lurker, this code is severely outdated


<?php
  query_posts( array( 'post_type' => 'portfolio', 'toolkit' => 'preparation' ) );
  //the loop start here
  if ( have_posts() ) : while ( have_posts() ) : the_post();
?>
  <h3><?php the_title(); ?></h3>
  <?php the_content(); ?>
<?php endwhile; endif; wp_reset_query(); ?>