Wordpress: List all posts in 2 columns

Discussion in 'WordPress' started by Ruriko, Apr 25, 2009.

  1. #1
    Can someone tell me how I can make a list of all my posts in a list format in 2 columns with alphabetical letters. So far this code only made 1 column I want it into 2 columns

    <?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;
    ?>
    Code (markup):

     
    Ruriko, Apr 25, 2009 IP
  2. webdesigners

    webdesigners Banned

    Messages:
    534
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #2
    You can use recent post plugins to set that.
     
    webdesigners, Apr 25, 2009 IP
  3. Ruriko

    Ruriko Well-Known Member

    Messages:
    4,023
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Recent posts plugin can't list all the post and it doesn't give each alphabetical letter
     
    Ruriko, Apr 25, 2009 IP
  4. SEO-UK

    SEO-UK Peon

    Messages:
    179
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    SEO-UK, Apr 25, 2009 IP