Two posts per “row”
-
Hi! Iv’e modified the post page so that it shows two posts per row, like this:
post 1 | post 2
post 3 | post 4and so on. For some reason it doesnt post it that way, it randomly puts them in unorder. For example:
post 3 | post 1
post 2 | post 4Heres my code
<div id="content_inner"> <h1><?php single_cat_title(); ?></h1> <div id="context"> <div class="catext"><?php echo category_description(); ?></div> <?php if (have_posts()) : while(have_posts()) : $i++; if(($i % 2) == 0) : $wp_query->next_post(); else : the_post(); ?> <div id="vanster"> <div id="centering"> <?php the_content(); ?> </div> <div id="bildtext"> <?php the_tags('Konstnär: ', ', ', '<br />'); ?> Kategori: <?php the_category(', ') ?> </div> </div> <?php endif; endwhile; else: ?> <div id="texter"> Tyvärr har vi just nu inget av visa här i "<?php single_cat_title(); ?>". </div> <?php endif; ?> <?php $i = 0; rewind_posts(); ?> <?php if (have_posts()) : while(have_posts()) : $i++; if(($i % 2) !== 0) : $wp_query->next_post(); else : the_post(); ?> <div id="hoger"> <div id="centering"> <?php the_content(); ?> </div> <div id="bildtext"> <?php the_tags('Konstnär: ', ', ', '<br />'); ?> Kategori: <?php the_category(', ') ?> </div> </div> <?php endif; endwhile; else: ?> <?php endif; ?> </div>Can someone with experience with php make it do what i want? Thank you very much in advance!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Two posts per “row”’ is closed to new replies.