
Category.php
By:
icodeinpink on Jan 28th, 2012 | syntax:
PHP | size: 1.13 KB | hits: 26 | expires: Never
<div class="mainBoxIndex">
<h2 style="padding-top:5px;"><?php
printf( __( 'You are here: %s | <a class="goBack" href="javascript:history.go(-1)">Go Back</a>', 'twentyten' ), '' . single_cat_title( '', false ) . '' );
?></h2>
<?php if (have_posts()) : while(have_posts()) : $i++; if(($i % 2) == 0) : $wp_query->next_post(); else : the_post(); ?>
<div id="left-column">
<h1><a href="<?php the_permalink();?>"><?php the_title();?></a></h1>
<p class="locationInfo"><?php the_field('location_field');?></p>
<img src="<?php echo the_field('featured_image'); ?>"/>
</div>
<?php endif; endwhile; else: ?>
<div>Alternate content</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="right-column">
<h1><a href="<?php the_permalink();?>"><?php the_title();?></a></h1>
<p class="locationInfo"><?php the_field('location_field');?></p>
<img src="<?php echo the_field('featured_image'); ?>"/>
</div>
<?php endif; endwhile; ?>
<div>Alternate content</div>
<?php endif; ?>
</ul>
</div>