Apply DIV to every item in loop?
-
Hello,
I am a newbie with WordPress loops so hopefully someone can help. I am trying to pull news items from WordPress from a specific category and get EACH news item to be wrapped in a div. Right now, it pulls all the news items and places them inside one large div. Thanks in advance! Here is my code:
<?php if ( query_posts('cat=1') ) { ?> <div class="newsitem"> <?php } ?> <?php query_posts('cat=1'); ?> <p><?php the_time('F jS, Y'); ?></p> <?php while (have_posts()) : the_post(); ?> <h4><a>"><?php the_title(); ?></a></h4> <?php the_content(); ?> <?php endwhile;?></div>
- The topic ‘Apply DIV to every item in loop?’ is closed to new replies.