put query_posts of 1 category in 3 horizontal columns
-
hi, im trying to put inside 3 columns query_posts of 1 category
<div id="content"> <?php $count = 1; $col_count = 3; $num_of_posts = $wp_query->post_count; $post_per_column = ceil($num_of_posts / $col_count); ?> <div id="col1"> <?php query_posts($query_string . '&cat=28'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="item entry" id="post-<?php the_ID(); ?>"></div> <?php global $post; ?> <div class="post" style="background: url(<?php echo $src[0]; ?>) #fff no-repeat;"> <div class="post_title"><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2></div> </div> <?php if($count == $post_per_column) { echo '</div><div id="col2">'; } if($count == 2*$post_per_column) { echo '</div><div id="col3">'; } $count++; endwhile; ?> <?php endif; ?> <br class="clearBoth"/>
i founded on the web this code and i modified for my web site but i have some issue i have the 3 columns white background but the post go only on the first columns
any help ?! thanks!
- The topic ‘put query_posts of 1 category in 3 horizontal columns’ is closed to new replies.