<?php get_header(); ?>
<?php
$aOptions = SofaiBloggr::initOptions( false );
$latest_articles = ( strlen( $aOptions[ 'latest_articles' ] ) > 0 ) ? stripslashes( $aOptions[ 'latest_articles' ] ) : 'Recently posted';
?>

<div id="articles" class="section">
<h2 class="sectionheader">最新文章</h2>
<?php 
if( have_posts() ) : 
echo '<ol class="post-list">';
while( have_posts() ) : the_post();
?>
	<li>
		<div class="postinfo">
			<span class="date"><?php the_time( 'M j, Y' ); ?></span>
			|
			<span class="category"><?php the_category( ', ' ); ?></span>

			<span class="comments-count"><?php comments_number( '0', '1', '%' ); ?></span>
		</div>
		<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
	</li>
<?php 
endwhile; 
echo '</ol>';
else : 
?>
<p>No articles in database!</p>
<?php endif; ?>

<div id="pagination">
	<?php 
    if( $wp_query->max_num_pages > 1 ) {
        // paging
        include( "wp-pagenavi.php" );
        if( function_exists( 'wp_pagenavi' ) ) { wp_pagenavi(); }
    } 
    ?>
</div><!-- pagination end -->

</div><!-- // articles end -->

<?php get_footer(); ?>
