/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function home_recent_post() { if (is_front_page()) { echo '<ul>Recent Posts'; $my_query = new WP_Query('showposts=5'); while ($my_query->have_posts()) : $my_query->the_post(); echo '<li>'; the_title(); the_excerpt(); echo '</li>'; endwhile; echo '</ul>'; } wp_reset_query(); } add_action ('thesis_hook_after_post','home_recent_post');