I am using this code to get custom posts in rows.
<?php query_posts('posts_per_page=72&cat=' . $cat . '&order=ASC');
$columns = 5;
$increment = 0;
?>
<table class="cat">
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<?php if($increment % $columns == 0){ // if increment is divisable by columns (ie 3/3 = 0))?>
<tr>
<td>
<div class="post" id="<?php the_ID(); ?>">
<div class="entry"><a href="<?php the_permalink() ?>" rel="<?php _e("bookmark", "solostream"); ?>" title="<?php _e("Permanent Link to", "solostream"); ?> <?php the_title(); ?>"><?php the_post_thumbnail( 'homepage-thumb' ); ?></a><br>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</div>
</div> <!-- .post -->
</td>
<?php
}else{
?>
<td>
<div class="post" id="<?php the_ID(); ?>">
<div class="entry"><a href="<?php the_permalink() ?>" rel="<?php _e("bookmark", "solostream"); ?>" title="<?php _e("Permanent Link to", "solostream"); ?> <?php the_title(); ?>"><?php the_post_thumbnail( 'homepage-thumb' ); ?></a><br>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</div>
</div> <!-- .post -->
</td>
<?php }$increment++; endwhile; endif;?>
</tr></table>
Problem is that it does not give custom posts. I want to use it on category page. How to amend first section so it automatically grabs posts from current category of either posts or custom post type.
Using
query_posts()
you can pass'post_type=custom-post-type'
it will however not work with a category associated with default posts but instead you can pass the custom taxonomy name are the valuetaxonomy=taxonomy_value
You’ll need to do something like: