開啟feed功能
步驟一:
在模版文件的<head></head>元素中添加wp_head()函數,且wp_head()函數要放在</head>標簽之前,而且緊鄰</head>標簽,如:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>開啟feed功能</title> <?php wp_head();?> </head> <body> </body> </html>
步驟二:
在主題的functions.php中,添加一段代碼,開啟feed自動鏈接功能,代碼如下:
add_theme_support( 'automatic-feed-links' );
步驟三:在模版文件中,添加一個訂閱地址告訴用戶:
<a href="<?php bloginfo('rss2_url');?>">rss訂閱</a>
幫助文檔:
中文官方參考文檔:http://codex.wordpress.org/zh-cn:%E4%B8%BB%E9%A2%98%E7%89%B9%E6%80%A7
英文官方參考文檔:http://codex.wordpress.org/Theme_Features