/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<div id="recentPost"> <ul> <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?> <li> <div class="column <?php if($i == 4 || $i == 8 || $i == 12 ): ?>last<?php endif; ?>"> <?php if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) : /* if post has post thumbnail */ ?> <div class="image"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('related-thumbnail'); ?></a></div> <?php endif; ?> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> </div><!--column--> </li> <?php $i++; ?> <?php endwhile; ?> </ul> </div>