我有一個模板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