List all posts in 2 columns
-
How do you make a list of all your posts in 2 columns with the alphabetical letters? So far this code can only make 1 column
<?php // Reference: http://wordpress.org/support/topic/148727 $posts = new WP_Query("cat=3&orderby=title&order=ASC&showposts=-1"); if ($posts->have_posts()) : for($i='A';$i!='AA';$i++) : ?> <h3 id="<?php echo $i; ?>"></a><?php echo $i; ?></h3> <ul> <?php while ($posts->have_posts()) : $posts->the_post(); if( $i == strtoupper(trim(substr($post->post_title, 0, 1))) ) : ?> <li><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li> <?php endif; endwhile; ?> </ul> <?php endfor; endif; ?>
The topic ‘List all posts in 2 columns’ is closed to new replies.