/ Published in: PHP
No plugin necessary, uses "loop" and default WP Thumnail
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $recent = new WP_Query("category_name=blog,news&showposts=3"); while($recent->have_posts()) : $recent->the_post();?> <div class="hmpg-blog-post"> <div class="hmpg-blog-postimage"> <?php } else { ?> <a href="<?php the_permalink(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/hmpg-blog-thumb.jpg" width="100px" height="100px" border="0" alt="<?php bloginfo('name'); ?>" /></a> <?php } } ?> </div><!-- hmpg-blog-postimage --> <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2> <?php the_content_limit(160, "Read more"); ?> </div><!-- hmpg-blog-post --> <?php endwhile; ?>