这是该页面的一个示例,它按字母顺序显示前十个帖子:
<?php
require('/the/path/to/your/wp-blog-header.php');
?>
<?php
$posts = get_posts('numberposts=10&order=ASC&orderby=post_title');
foreach ($posts as $post) : start_wp(); ?>
<?php the_date(); echo "<br />"; ?>
<?php the_title(); ?>
<?php the_excerpt(); ?>
<?php
endforeach;
?>
Run Code Online (Sandbox Code Playgroud)
使用$posts = get_posts('numberposts=10');,如果你想在10个最新的帖子.