how to make this code a true double column index.php
-
i got this code but doesnt work normaly: both columns arent equal(same number of posts on each one), how can i have two columns with equal posts on each one? thanks for your help
<?php get_header(); ?> <div id="content" class="narrowcolumn"> <div class="column-left"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php $post_counter++; if($post_counter > 4) : ?> </div> <div class="column-right"> <?php endif; ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Lien vers <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('j F Y') ?> | <?php comments_popup_link('Aucun commentaire', '1 Commentaire', '% Commentaires'); ?> | <?php the_category(', ') ?> </small> <div class="entry"> <?php ob_start(NULL); the_excerpt(); $tmp = ob_get_contents(); ob_clean(); the_permalink(); $permalink = ob_get_contents(); ob_clean(); the_title_attribute(); $title = ob_get_contents(); ob_end_clean(); $link = '<a href="'.$permalink.'" rel="bookmark" title="Lien vers '.$title.'">[...]</a>'; $tmp = str_replace('[...]',$link,$tmp); //the_excerpt doesn't show [...] for user defined excerpts. in such cases always put our read more link if(!empty($post->post_excerpt)) { //This post have an excerpt, let's display it $link = $link.'</p>'; $tmp = str_replace('</p>',$link,$tmp); } echo $tmp; ?> </div> </div> <?php endwhile; ?> </div> <div class="navigation"> <div class="alignleft"><?php next_posts_link('« Articles précédents') ?></div> <div class="alignright"><?php previous_posts_link('Articles suivants »') ?></div> </div> <?php else : ?> <h2 class="center">Page non trouvée!</h2> <p class="center">L'article que vous cherchez n'existe pas. Il a pu être supprimé ou renommé. Veuillez utiliser les menus de navigation ou la barre de recherche pour le retrouver.</p> <?php endif; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘how to make this code a true double column index.php’ is closed to new replies.