我有一个模板No Sidebars
我想要一个页面按作者列出5帖该网页上的标题,其中作者的名字=页面的标题如何选择特定作者的帖子? (WordPress的)
任何想法如何不使用任何插件,这样做呢?
我认为query_posts功能会做的伎俩,但this important note种告诉我,我不能使用query_posts
我有一个模板No Sidebars
我想要一个页面按作者列出5帖该网页上的标题,其中作者的名字=页面的标题如何选择特定作者的帖子? (WordPress的)
任何想法如何不使用任何插件,这样做呢?
我认为query_posts功能会做的伎俩,但this important note种告诉我,我不能使用query_posts
这里的代码位将可能是作者让你的帖子标题;为了这个自动断料的页面标题我有你的标题生成代码的...希望这可以帮助你得到的方式出现的至少一部分......
<?php $my_query = new WP_Query('author_name=YourAuthor&showposts=5'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
<?php the_title(); ?></a><?php endwhile; ?>
退房Function Reference/WP Query « WordPress Codex和较早的答案(使用相同的代码:)作为poindexter的)在Wordpress display featured posts outside of loop
很好,很好地工作。谢谢。 – Radek 2010-05-15 12:53:18