WordPress Code To Show a List of Recent Posts
06.11.2011
<ul>
<?php
global $post;
$args = array( ‘numberposts’ => 5);
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<li><b><?php the_date(); ?></b>
<a href=”<?php the_permalink(); ?>”><?php the_title(”,”,true); ?></a></li>
<?php endforeach; ?>
</ul>
The CSS:
.frontpage section article ul li {list-style-type:none; margin:0 20px;}
.frontpage section article ul li b {display:block;}