All pastes #612932 Raw Edit

3 Loops

public php v1 · immutable
·published 2007-07-10 18:29 UTC
rendered paste body
<div id="hot"><span class="fresh">Hot Fresh Topics</span> <?php query_posts('cat=-3&showposts=4'); // exclude the third category ?> <?php while (have_posts()) : the_post(); // start your Loop ?><h4 class="storytitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> <?php the_time('d.m.Y'); ?><br /><?php the_excerpt_reloaded(30, '', '<a><img>', TRUE, 'Keep reading...', FALSE, 2); ?> <?php endwhile; ?></div>  <div id="latest"> <!--latest starts; displays one post from cat 3-->      <?php $top_query = new WP_Query('cat=3&showposts=1'); ?>      <?php while($top_query->have_posts()) : $top_query->the_post(); $first_post = $post->ID; ?>      <h2 class="editorial">The Weekly Buzzword</h2>      <h2 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2>      	<br />      	      	<div class="storycontent">      		<?php the_content(); ?>      	</div>      	<br />      	<div class="feedback">                  <?php wp_link_pages(); ?>                  <div class="alignleft"><div class="meta foe" ><?php _e("Published in:"); ?> <?php the_category() ?>  on <?php the_time('d.m.Y.') ?> <?php edit_post_link(); ?>        </div></div>                  <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)'), 'commentlink'); ?>      	</div>      	      	<!--      	<?php trackback_rdf(); ?>      	-->            <?php comments_template(); // Get wp-comments.php template ?>      <?php endwhile; ?>     </div> <!--latest ends-->             <div id="content">      <div class="recentheader">More recent articles</div>              <?php query_posts('showposts=4&cat=-3&offset=4'); ?>        <?php while(have_posts()) : the_post(); if(!($first_post == $post->ID)) : ?>                <?php// the_date('','<h2>','</h2>'); ?>        	            <div class="post"> <!--div post starts-->            	 <h2 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>            	<div class="meta"><?php _e("Published in:"); ?> <?php the_category(',') ?> &#8212; <?php// the_author() ?> <?php the_time('d.m.Y. - G:i') ?> <?php edit_post_link(__('Edit This')); ?> |               </div>            	            	<div class="storycontent">            		<?php the_excerpt(); ?>            	</div>            	            	<div class="feedback">                        <?php wp_link_pages(); ?>                        <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)'), 'commentlink'); ?>            	</div>            	<div class="separator"></div>            	<!--            	<?php trackback_rdf(); ?>            	-->                        <?php comments_template(); // Get wp-comments.php template ?>                        </div> <!--div post ends-->                <?php endif; endwhile; ?>