<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wordpress-Ing &#187; 调用</title>
	<atom:link href="http://wordpress.rssbbs.com/tag/%e8%b0%83%e7%94%a8/feed/" rel="self" type="application/rss+xml" />
	<link>http://wordpress.rssbbs.com</link>
	<description>我们一起体验wordpress吧！</description>
	<lastBuildDate>Sat, 16 Jan 2010 15:58:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>wordpress调用最新文章/随机文章/最新留言</title>
		<link>http://wordpress.rssbbs.com/2008/12/16/wordpress%e8%b0%83%e7%94%a8%e6%9c%80%e6%96%b0%e6%96%87%e7%ab%a0%e9%9a%8f%e6%9c%ba%e6%96%87%e7%ab%a0%e6%9c%80%e6%96%b0%e7%95%99%e8%a8%80/</link>
		<comments>http://wordpress.rssbbs.com/2008/12/16/wordpress%e8%b0%83%e7%94%a8%e6%9c%80%e6%96%b0%e6%96%87%e7%ab%a0%e9%9a%8f%e6%9c%ba%e6%96%87%e7%ab%a0%e6%9c%80%e6%96%b0%e7%95%99%e8%a8%80/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 13:37:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordpress进阶技巧]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[文章]]></category>
		<category><![CDATA[留言]]></category>
		<category><![CDATA[调用]]></category>

		<guid isPermaLink="false">http://wordpress.rssbbs.com/?p=30</guid>
		<description><![CDATA[1. 最新文章
Wordpress最新文章的调用可以使用一行很简单的模板标签wp_get_archvies来实现. 代码如下：

&#60;?php get_archives&#40;'postbypost', 10&#41;; ?&#62; (显示10篇最新更新文章)


或者

wp_get_archives&#40;'type=postbypost&#38;limit=20&#38;format=custom'&#41;; ?&#62;

后面这个代码显示你博客中最新的20篇文章，其中format=custom这里主要用来自定义这份文章列表的显示样式。具体的参数和使用方法你可以参考官方的使用说明- wp_get_archvies。(fromat=custom也可以不要，默认以UL列表显示文章标题。)
补充: 通过WP的query_posts()函数也能调用最新文章列表， 虽然代码会比较多一点，但可以更好的控制Loop的显示，比如你可以设置是否显示摘要。具体的使用方法也可以查看官方的说明。
2. 随机文章

&#60;?php
$rand_posts = get_posts&#40;'numberposts=10&#38;orderby=rand'&#41;;
foreach&#40; $rand_posts as $post &#41; :
?&#62;
&#60;!--下面是你想自定义的Loop--&#62;
&#60;li&#62;&#60;a href=&#34;&#60;?php the_permalink&#40;&#41;; ?&#62;&#34;&#62;&#60;?php the_title&#40;&#41;; ?&#62;&#60;/a&#62;&#60;/li&#62;
&#60;?php endforeach; ?&#62;

3. 最新留言
下面是我之前在一个Wordpress主题中代到的最新留言代码，具体也记不得是哪个主题了。该代码直接调用数据库显示一份最新留言。其中LIMIT 10限制留言显示数量。绿色部份则是每条留言的输出样式。

&#60;?php
global $wpdb;
$sql = &#34;SELECT DISTINCT ID, post_title, post_password, comment_ID,
comment_post_ID, comment_author, comment_date_gmt, comment_approved,
comment_type,comment_author_url,
SUBSTRING(comment_content,1,30) AS com_excerpt
FROM $wpdb-&#62;comments
LEFT OUTER JOIN $wpdb-&#62;posts ON ($wpdb-&#62;comments.comment_post_ID =
$wpdb-&#62;posts.ID)
WHERE comment_approved = '1' AND comment_type = '' [...]]]></description>
		<wfw:commentRss>http://wordpress.rssbbs.com/2008/12/16/wordpress%e8%b0%83%e7%94%a8%e6%9c%80%e6%96%b0%e6%96%87%e7%ab%a0%e9%9a%8f%e6%9c%ba%e6%96%87%e7%ab%a0%e6%9c%80%e6%96%b0%e7%95%99%e8%a8%80/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>wordpress模板和调用函数</title>
		<link>http://wordpress.rssbbs.com/2008/12/16/wordpress%e6%a8%a1%e6%9d%bf%e5%92%8c%e8%b0%83%e7%94%a8%e5%87%bd%e6%95%b0/</link>
		<comments>http://wordpress.rssbbs.com/2008/12/16/wordpress%e6%a8%a1%e6%9d%bf%e5%92%8c%e8%b0%83%e7%94%a8%e5%87%bd%e6%95%b0/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 10:04:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordpress进阶技巧]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[函数]]></category>
		<category><![CDATA[模板]]></category>
		<category><![CDATA[调用]]></category>

		<guid isPermaLink="false">http://wordpress.rssbbs.com/?p=22</guid>
		<description><![CDATA[WordPress基本模板文件
一套完整的WordPress模板应至少具有如下文件：
style.css : CSS(样式表)文件
index.php : 主页模板
archive.php : Archive/Category模板
404.php : Not Found 错误页模板
comments.php : 留言/回复模板
footer.php : Footer模板
header.php : Header模板
sidebar.php : 侧栏模板
page.php : 内容页(Page)模板
single.php : 内容页(Post)模板
searchform.php : 搜索表单模板
search.php : 搜索结果模板
当然，具体到特定的某款模板，可能不止这些文件，但一般而言，这些文件是每套模板所必备的。
基本条件判断Tag
is_home() : 是否为主页
is_single() : 是否为内容页(Post)
is_page() : 是否为内容页(Page)
is_category() : 是否为Category/Archive页
is_tag() : 是否为Tag存档页
is_date() : 是否为指定日期存档页
is_year() : 是否为指定年份存档页
is_month() : 是否为指定月份存档页
is_day() : 是否为指定日存档页
is_time() : 是否为指定时间存档页
is_archive() : 是否为存档页
is_search() : 是否为搜索结果页
is_404() : 是否为 “HTTP 404: [...]]]></description>
		<wfw:commentRss>http://wordpress.rssbbs.com/2008/12/16/wordpress%e6%a8%a1%e6%9d%bf%e5%92%8c%e8%b0%83%e7%94%a8%e5%87%bd%e6%95%b0/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>wordpress函数调用集合</title>
		<link>http://wordpress.rssbbs.com/2008/12/16/wordpress%e5%87%bd%e6%95%b0%e8%b0%83%e7%94%a8%e9%9b%86%e5%90%88/</link>
		<comments>http://wordpress.rssbbs.com/2008/12/16/wordpress%e5%87%bd%e6%95%b0%e8%b0%83%e7%94%a8%e9%9b%86%e5%90%88/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 10:02:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordpress进阶技巧]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[函数]]></category>
		<category><![CDATA[调用]]></category>

		<guid isPermaLink="false">http://wordpress.rssbbs.com/?p=20</guid>
		<description><![CDATA[WP函数记录
wp_head();
bloginfo(&#8216;home&#8217;);
bloginfo(&#8216;name&#8217;);  // 默认
bloginfo(&#8216;url&#8217;);  == echo get_option(&#8216;home&#8217;);
bloginfo(&#8217;stylesheet_url&#8217;);
have_posts();
while(have_posts()):the_post();
  the_title();
  the_ID();
  the_author();
  the_category(&#8216;, &#8216;);
  the_permalink();
  the_content();
  comments_popup_link();
endwhile;
posts_nav_link(&#8220;between&#8221;, &#8220;prev&#8221;, &#8220;next&#8221;);
previous_post_link(&#8220;Prev: %link&#8221;);
next_post_link(&#8220;Next: %link&#8221;);
comments_template();
wp_list_pages(&#8220;depth=3&#038;title_li=
Pages
&#8220;);
wp_list_cats(&#8220;sort_column=name&#038;optioncount=1&#038;hierarchical=0&#8243;);
wp_get_archives(&#8220;type=monthly&#8221;);
get_calendar();
wp_specialchars($s, 1); // searchform
wp_register();
wp_loginout();
wp_meta();
get_header();
get_sidebar();
get_footer();
link_pages(&#8220;
Pages:&#8220;, &#8220;
&#8220;, &#8220;number&#8221;); 显示子页面
edit_post_link(&#8220;]]></description>
		<wfw:commentRss>http://wordpress.rssbbs.com/2008/12/16/wordpress%e5%87%bd%e6%95%b0%e8%b0%83%e7%94%a8%e9%9b%86%e5%90%88/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
