Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <section>
- <div id="news">
- <?php $list_news = new WP_Query('cat=3&showposts=-1'); ?>
- <?php $count = 0; ?>
- <?php while ($list_news->have_posts()) : $list_news->the_post(); $do_not_duplicate = $post->ID; ?>
- <?php $count++; ?>
- <?php if ($count == 1) : ?>
- <div class="col_one">
- <article>
- <h3><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a></h3>
- <?php the_content(); ?>
- </article>
- </div> <!-- col_one -->
- <?php elseif ($count == 2 || $count == 3 || $count == 4) : ?>
- <?php if ($count == 2) : ?>
- <div class="col_two">
- <?php endif; ?>
- <article>
- <h3><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a></h3>
- <?php the_content(); ?>
- </article>
- <?php if ($count == 4 || ($list_news->current_post+1) == $list_news->post_count ) : ?>
- </div> <!-- col_two -->
- <?php endif; ?>
- <?php else : ?>
- <?php if ($count == 5) : ?>
- <div class="col_three">
- <?php endif; ?>
- <article>
- <h3><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a></h3>
- </article>
- <?php if ( ($list_news->current_post+1) == $list_news->post_count ) : ?>
- </div> <!-- col_three -->
- <?php endif; ?>
- <?php endif; ?>
- <?php endwhile; ?>
- </div> <!-- end news -->
- </section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement