{"id":2424,"date":"2025-06-11T02:11:05","date_gmt":"2025-06-10T18:11:05","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/wpcms\/wpdt\/2424.html"},"modified":"2025-06-11T02:11:05","modified_gmt":"2025-06-10T18:11:05","slug":"%e5%a6%82%e4%bd%95%e9%99%90%e5%88%b6wordpress-rss%e8%ae%a2%e9%98%85%e4%b8%ad%e7%9a%84%e6%96%87%e7%ab%a0%e6%95%b0%e9%87%8f","status":"publish","type":"post","link":"https:\/\/www.zhaozhao123.cn\/wpcms\/post\/2424.html","title":{"rendered":"\u5982\u4f55\u9650\u5236WordPress RSS\u8ba2\u9605\u4e2d\u7684\u6587\u7ae0\u6570\u91cf"},"content":{"rendered":"<div class=\"wp-block-columns p-0 border is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-columns px-4 py-3 border-bottom has-background is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\" style=\"background:linear-gradient(243deg,rgb(238,238,238) 0%,rgba(58,166,242,0.15) 100%)\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\r\n<figure class=\"wp-block-image size-thumbnail is-resized is-style-rounded is-style-rounded--1\"><img decoding=\"async\" src=\"https:\/\/www.zhaozhao123.cn\/myitems\/images\/sites16\/2025\/06\/dyA-1-400x300.jpg\" alt=\"Bug&#32534;&#35793;&#29422;\" class=\"wp-image-1842\" style=\"object-fit:cover;width:30px;height:30px\"><\/figure>\r\n\r\n\r\n\r\n<p class=\"my-0\">Bug&#32534;&#35793;&#29422;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n\r\n\r\n<div class=\"wp-block-columns px-xl-5 px-4 py-xl-4 py-3 is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<p>&#20026;&#20102;&#38480;&#21046;WordPress RSS&#35746;&#38405;&#20013;&#30340;&#25991;&#31456;&#25968;&#37327;&#65292;&#20320;&#21487;&#20197;&#36890;&#36807;&#20197;&#19979;&#20960;&#31181;&#26041;&#27861;&#23454;&#29616;&#65306;<\/p>\n<h3>&#26041;&#27861;&#19968;&#65306;&#20351;&#29992;&#25554;&#20214;<\/h3>\n<ol>\n<li>\n<p><strong>&#23433;&#35013;&#21644;&#28608;&#27963;&ldquo;RSS Limit&rdquo;&#25554;&#20214;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#36827;&#20837;WordPress&#21518;&#21488;&#65292;&#23548;&#33322;&#21040;&ldquo;&#25554;&#20214;&rdquo;-&gt;&ldquo;&#28155;&#21152;&#26032;&#25554;&#20214;&rdquo;&#65292;&#25628;&#32034;&#24182;&#23433;&#35013;&ldquo;RSS Limit&rdquo;&#12290;&#28982;&#21518;&#28608;&#27963;&#35813;&#25554;&#20214;&#12290;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>&#37197;&#32622;&#38480;&#21046;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#22312;&#25554;&#20214;&#35774;&#32622;&#39029;&#38754;&#65288;&#36890;&#24120;&#26159;<code>Settings &gt; RSS Limit<\/code>&#65289;&#19978;&#65292;&#21487;&#20197;&#35843;&#25972;&#27599;&#20010;&#29992;&#25143;&#27599;&#22825;&#25110;&#27599;&#26376;&#30340;RSS&#35746;&#38405;&#25991;&#31456;&#25968;&#37327;&#38480;&#21046;&#12290;<\/li>\n<li>&#20363;&#22914;&#65292;&#22914;&#26524;&#20320;&#24076;&#26395;&#27599;&#20301;&#35746;&#38405;&#32773;&#21482;&#33021;&#30475;&#21040;&#21069;5&#31687;&#25991;&#31456;&#65292;&#21482;&#38656;&#22312;&#30456;&#24212;&#36873;&#39033;&#20013;&#35774;&#32622;&#20026;5&#21363;&#21487;&#12290;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>&#24212;&#29992;&#38480;&#21046;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#37197;&#32622;&#23436;&#25104;&#21518;&#65292;&#25152;&#26377;&#20351;&#29992;&#27492;RSS&#35746;&#38405;&#30340;&#29992;&#25143;&#37117;&#23558;&#21463;&#21040;&#38480;&#21046;&#65292;&#19981;&#33021;&#26597;&#30475;&#36229;&#36807;&#35774;&#23450;&#30340;&#25991;&#31456;&#25968;&#12290;<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>&#31034;&#20363;&#20195;&#30721;<\/h3>\n<p>&#20551;&#35774;&#20320;&#24050;&#32463;&#23433;&#35013;&#24182;&#28608;&#27963;&#20102;&ldquo;RSS Limit&rdquo;&#25554;&#20214;&#65292;&#19979;&#38754;&#26159;&#22914;&#20309;&#20351;&#29992;&#23427;&#30340;&#22522;&#26412;&#27493;&#39588;&#65306;<\/p>\n<pre><code class=\"language-php\">\/\/ &#25554;&#20214;&#30446;&#24405;&#36335;&#24452;\n$plugin_path = get_stylesheet_directory() . '\/rss_limit.php';\n\n\/\/ &#26816;&#26597;&#25554;&#20214;&#26159;&#21542;&#24050;&#21152;&#36733;\nif (file_exists($plugin_path)) {\n    \/\/ &#35843;&#29992;&#25554;&#20214;&#20989;&#25968;&#26469;&#33719;&#21462;&#24403;&#21069;&#29992;&#25143;&#30340;&#35746;&#38405;&#24773;&#20917;\n    $current_user_subscriptions = plugin_function('get_current_user_subscriptions')();\n\n    \/\/ &#35774;&#32622;&#27599;&#26085;&#26368;&#22823;&#38405;&#35835;&#37327;&#38480;&#21046;\n    $daily_limit = 5;\n\n    \/\/ &#33719;&#21462;&#24403;&#21069;&#26085;&#26399;\n    $today = date(\"Y-m-d\");\n\n    \/\/ &#21028;&#26029;&#26159;&#21542;&#36229;&#36807;&#27599;&#26085;&#38480;&#20540;\n    if ($current_user_subscriptions['read'] &gt;= $daily_limit) {\n        echo \"&#24744;&#20170;&#22825;&#24050;&#32463;&#38405;&#35835;&#20102;&#36229;&#36807;{$daily_limit}&#31687;&#25991;&#31456;&#65292;&#35831;&#26126;&#22825;&#20877;&#35835;&#21543;&#65281;\";\n    } else {\n        \/\/ &#22914;&#26524;&#27809;&#26377;&#36798;&#21040;&#19978;&#38480;&#65292;&#21017;&#20801;&#35768;&#32487;&#32493;&#38405;&#35835;\n        echo \"&#27426;&#36814;&#32487;&#32493;&#38405;&#35835;&#65281;\";\n    }\n}<\/code><\/pre>\n<h3>&#20351;&#29992;&#27493;&#39588;<\/h3>\n<ol>\n<li>&#23558;&#19978;&#36848;PHP&#20195;&#30721;&#20445;&#23384;&#20026;&#19968;&#20010;<code>.php<\/code>&#25991;&#20214;&#65292;&#23558;&#20854;&#25918;&#22312;&#20320;&#30340;&#20027;&#39064;&#30446;&#24405;&#19979;&#30340;<code>functions.php<\/code>&#25110;&#20854;&#20182;&#36866;&#24403;&#20301;&#32622;&#12290;<\/li>\n<li>&#30830;&#20445;&#35813;&#25991;&#20214;&#34987;&#20027;&#39064;&#25903;&#25345;&#65292;&#24182;&#19988;&#33021;&#22815;&#27491;&#30830;&#25191;&#34892;&#12290;<\/li>\n<li>&#27979;&#35797;&#25554;&#20214;&#30340;&#21151;&#33021;&#65292;&#30830;&#20445;&#23427;&#25353;&#39044;&#26399;&#24037;&#20316;&#65292;&#19981;&#20250;&#23548;&#33268;&#20219;&#20309;&#38169;&#35823;&#25110;&#19981;&#24517;&#35201;&#30340;&#34892;&#20026;&#12290;<\/li>\n<\/ol>\n<h3>&#27880;&#24847;&#20107;&#39033;<\/h3>\n<ul>\n<li>&#22312;&#21551;&#29992;&#20219;&#20309;&#21151;&#33021;&#20043;&#21069;&#65292;&#35831;&#30830;&#20445;&#27979;&#35797;&#29615;&#22659;&#23613;&#21487;&#33021;&#25509;&#36817;&#29983;&#20135;&#29615;&#22659;&#65292;&#20197;&#36991;&#20813;&#21487;&#33021;&#30340;&#24847;&#22806;&#24433;&#21709;&#12290;<\/li>\n<li>&#23450;&#26399;&#26816;&#26597;&#25554;&#20214;&#26356;&#26032;&#65292;&#20197;&#30830;&#20445;&#20854;&#23433;&#20840;&#24615;&#21644;&#20860;&#23481;&#24615;&#12290;<\/li>\n<\/ul>\n<p>&#36890;&#36807;&#20197;&#19978;&#26041;&#27861;&#65292;&#20320;&#21487;&#20197;&#26377;&#25928;&#22320;&#38480;&#21046;WordPress RSS&#35746;&#38405;&#20013;&#30340;&#25991;&#31456;&#25968;&#37327;&#65292;&#20445;&#25252;&#29992;&#25143;&#30340;&#38405;&#35835;&#20307;&#39564;&#12290;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div><div class=\"wp-block-columns p-0 border is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-columns px-4 py-3 border-bottom has-background is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\" style=\"background:linear-gradient(243deg,rgb(238,238,238) 0%,rgba(58,166,242,0.15) 100%)\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\r\n<figure class=\"wp-block-image size-thumbnail is-resized is-style-rounded is-style-rounded--2\"><img decoding=\"async\" src=\"https:\/\/www.zhaozhao123.cn\/myitems\/images\/sites16\/2025\/06\/zp-400x300.jpg\" alt=\"&#40657;&#26495;&#21069;&#30340;Bug&#35821;&#27861;&#35762;&#24072;\" class=\"wp-image-1849\" style=\"object-fit:cover;width:30px;height:30px\"><\/figure>\r\n\r\n\r\n\r\n<p class=\"my-0\">&#40657;&#26495;&#21069;&#30340;Bug&#35821;&#27861;&#35762;&#24072;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n\r\n\r\n<div class=\"wp-block-columns px-xl-5 px-4 py-xl-4 py-3 is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<p>&#38480;&#21046;WordPress RSS&#35746;&#38405;&#20013;&#30340;&#25991;&#31456;&#25968;&#37327;&#21487;&#20197;&#36890;&#36807;&#20462;&#25913;WordPress&#30340;RSS&#27169;&#26495;&#25991;&#20214;&#26469;&#23454;&#29616;&#12290;&#19979;&#38754;&#23558;&#35814;&#32454;&#20171;&#32461;&#22914;&#20309;&#25805;&#20316;&#12290;<\/p>\n<h3>1. &#25171;&#24320;WordPress&#26681;&#30446;&#24405;&#19979;&#30340;<code>wp-content\/themes\/your-theme\/<\/code>&#25991;&#20214;&#22841;&#12290;<\/h3>\n<ul>\n<li>&#22914;&#26524;&#20320;&#38656;&#35201;&#23545;&#29305;&#23450;&#30340;&#20027;&#39064;&#36827;&#34892;&#20462;&#25913;&#65292;&#35831;&#26367;&#25442;&#20026;&#23545;&#24212;&#30340;&#20027;&#39064;&#21517;&#12290;<\/li>\n<\/ul>\n<h3>2. &#22312;&#35813;&#20027;&#39064;&#30340;<code>rss.php<\/code>&#25991;&#20214;&#20869;&#28155;&#21152;&#20197;&#19979;&#20195;&#30721;&#65306;<\/h3>\n<pre><code class=\"language-php\">&lt;?php\n\/**\n * The RSS feed for this site.\n *\n * @package WordPress\n * @subpackage YourTheme\n *\/\n?&gt;\n&lt;!-- BEGIN RSS --&gt;\n&lt;rdf:RDF xmlns:rdf=\"http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#\" xmlns:dc=\"http:\/\/purl.org\/dc\/elements\/1.1\/\" xmlns:content=\"http:\/\/purl.org\/rss\/1.0\/modules\/content\/\" xmlns:atom=\"http:\/\/www.w3.org\/2005\/Atom\" xmlns:media=\"http:\/\/search.yahoo.com\/mrss\/\"&gt;\n    &lt;item&gt;\n        &lt;!-- ... &#20854;&#20182;&#20803;&#32032; ... --&gt;\n    &lt;\/item&gt;\n&lt;\/rdf:RDF&gt;\n&lt;!-- END RSS --&gt;\n<\/code><\/pre>\n<h3>3. &#20462;&#25913;WordPress&#26681;&#30446;&#24405;&#19979;&#30340;<code>functions.php<\/code>&#25991;&#20214;&#20013;&#30340;&#30456;&#24212;&#20989;&#25968;&#20197;&#38450;&#27490;&#36807;&#22810;&#30340;&#25991;&#31456;&#34987;&#21152;&#36733;&#21040;RSS&#20013;&#65306;<\/h3>\n<pre><code class=\"language-php\">function your_theme_rss() {\n    \/\/ &#20551;&#35774;&#20320;&#26377;&#19968;&#20010;&#21464;&#37327;$limit&#34920;&#31034;&#20320;&#35201;&#26174;&#31034;&#30340;RSS&#25991;&#31456;&#25968;\n    $limit = 10; \/\/ &#31034;&#20363;&#65306;&#26174;&#31034;&#26368;&#22810;10&#31687;&#25991;&#31456;\n\n    \/\/ &#26816;&#26597;&#24403;&#21069;&#39029;&#38754;&#26159;&#21542;&#21253;&#21547;&#36807;&#38271;&#30340;&#25991;&#31456;&#21015;&#34920;\n    if (isset($_GET['max_items'])) {\n        $max_items = $_GET['max_items'];\n        if ($max_items &gt; 0) {\n            $limit = min($max_items, $GLOBALS['wp_query']-&gt;max_num_pages);\n        }\n    }\n\n    \/\/ &#26681;&#25454;$limit&#35774;&#32622;&#27599;&#39029;&#26174;&#31034;&#30340;&#25991;&#31456;&#25968;\n    global $wp_query;\n    $wp_query-&gt;query_vars['posts_per_page'] = $limit;\n\n    \/\/ &#37325;&#36733;rss.php&#20197;&#26174;&#31034;&#25351;&#23450;&#25968;&#37327;&#30340;&#25991;&#31456;\n    include_once ABSPATH . 'wp-admin\/includes\/template.php';\n}\nadd_action('init', 'your_theme_rss');<\/code><\/pre>\n<h3>4. &#26356;&#26032;WordPress&#23433;&#35013;&#30446;&#24405;&#19979;&#30340;<code>.htaccess<\/code>&#25991;&#20214;&#65292;&#30830;&#20445;&#23427;&#20801;&#35768;&#35299;&#26512;&#21644;&#25191;&#34892;&#33258;&#23450;&#20041;&#30340;RSS&#25991;&#20214;&#65306;<\/h3>\n<pre><code class=\"language-apache\">RewriteEngine On\nRewriteBase \/\nRewriteRule ^feed\/(.*)$ \/rss\/$1 [L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^(.*)$ rss.php?post_type=your-post-type&amp;slug=$1 [QSA,L]<\/code><\/pre>\n<h3>5. &#30830;&#20445;&#20320;&#30340;&#32593;&#31449;&#37197;&#32622;&#27491;&#30830;&#65292;&#22914;&#20351;&#29992;&#20102;&#21512;&#36866;&#30340;&#25968;&#25454;&#24211;&#25110;&#25554;&#20214;&#65288;&#20363;&#22914;WPML&#65289;&#24182;&#35774;&#32622;&#20102;&#36866;&#24403;&#30340;&#35775;&#38382;&#25511;&#21046;&#31574;&#30053;&#12290;<\/h3>\n<h3>&#27880;&#24847;&#20107;&#39033;&#65306;<\/h3>\n<ul>\n<li><strong>&#35831;&#26681;&#25454;&#23454;&#38469;&#24773;&#20917;&#35843;&#25972;&#21464;&#37327;$limit&#30340;&#20540;<\/strong>&#65292;&#20363;&#22914;&#22914;&#26524;&#20320;&#24076;&#26395;&#26174;&#31034;10&#31687;&#25991;&#31456;&#65292;&#21487;&#20197;&#23558;&#20854;&#35774;&#32622;&#20026;10&#12290;<\/li>\n<li><strong>&#22914;&#26524;&#38656;&#35201;&#26356;&#22810;&#25511;&#21046;&#65292;&#21487;&#20197;&#22312;<code>.htaccess<\/code>&#25991;&#20214;&#20013;&#36827;&#19968;&#27493;&#23450;&#21046;&#35268;&#21017;<\/strong>&#12290;<\/li>\n<li><strong>&#30830;&#20445;&#20320;&#30340;&#32593;&#31449;&#24050;&#23433;&#35013;&#24182;&#21551;&#29992;&#20102;RSS&#21151;&#33021;<\/strong>&#12290;<\/li>\n<\/ul>\n<p>&#36890;&#36807;&#20197;&#19978;&#27493;&#39588;&#65292;&#20320;&#21487;&#20197;&#26377;&#25928;&#22320;&#38480;&#21046;WordPress RSS&#35746;&#38405;&#20013;&#30340;&#25991;&#31456;&#25968;&#37327;&#12290;&#36825;&#26377;&#21161;&#20110;&#20248;&#21270;&#29992;&#25143;&#20307;&#39564;&#65292;&#29305;&#21035;&#26159;&#23545;&#20110;&#22823;&#37327;&#25991;&#31456;&#30340;&#31449;&#28857;&#26469;&#35828;&#65292;&#36991;&#20813;&#19981;&#24517;&#35201;&#30340;&#25968;&#25454;&#20256;&#36755;&#12290;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Bug&#32534;&#35793;&#29422; &#20026;&#20102;&#38480;&#21046;WordPress RSS&#35746;&#38405;&#20013;&#30340;&#25991;&#31456;&#25968;&#37327;&#65292;&#20320;&#038;#21487..<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[59],"tuisongtax":[],"class_list":["post-2424","post","type-post","status-publish","format-standard","hentry","category-wpdt","tag-pzjc"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/2424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/comments?post=2424"}],"version-history":[{"count":0,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/2424\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/media?parent=2424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/categories?post=2424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tags?post=2424"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tuisongtax?post=2424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}