我在 WordPress 中有两个不同的帖子类别(“本地”和“国际”),并且在我的静态页面中显示了这些帖子。现在这两个类别的帖子都在一个页面上。我可以在页面中仅显示本地帖子local.php
和国际帖子吗?International.php
另请更改。我可以在顶部显示较新的帖子吗?现在较旧的帖子位于顶部。
以下是我的代码。
<?php
require('wp-blog-header.php');
?>
<?php
$posts = get_posts('numberposts=10&order=ASC&orderby=post_title');
foreach ($posts as $post) : start_wp(); ?>
<?php echo "<h1>";the_date();echo "</h1>"; ?>
<?php the_title(); ?>
<?php the_excerpt(); ?>
<?php
endforeach;
?>