admin管理员组文章数量:1291013
I am trying to debug why my page feed with is returning empty.
Here's the URL for same,
http://localhost/design-patterns/code-improvement/feed/
I'm seeing the following output here,
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content=".0/modules/content/"
xmlns:dc=".1/"
xmlns:atom=";
xmlns:sy=".0/modules/syndication/"
>
<channel>
<title>
Comments on: Checking Account </title>
<atom:link href="http://localhost/design-patterns/code-improvement/feed/" rel="self" type="application/rss+xml" />
<link>http://localhost/design-patterns</link>
<description>Just another WordPress site</description>
<lastBuildDate>Mon, 26 Apr 2021 06:33:50 +0000</lastBuildDate>
<sy:updatePeriod> hourly </sy:updatePeriod>
<sy:updateFrequency> 1 </sy:updateFrequency>
</channel>
</rss>
As you see there are no <item>
tags present, inspite of there being content in that page.
That is because,
while ( have_comments() ) :
at wp-includes\feed-rss2-comments.php
but the fact is wp-includes\feed-rss2-comments.php
should never have been called, instead I needed wp-includes\feed-rss2.php
which calls while ( have_posts() ) :
While debugging I reached till wp-includes\functions.php
In there the function which was getting called was do_feed_rss2
. Now according to the doc if the feed is for comments the $for_comments
flag should be true
.
What I observed in my case is it was giving true
value and since the page had no comments the feed was returning to be empty.
So I started searching for the do_action
call for do_feed_rss2
, thinking that is where the value must be getting set from, but all i could find is this,
Can anybody help me finding why is this $for_comments
flag getting set as true
?
Thank you.
本文标签: functionsWhy is my page feed returning empty content
版权声明:本文标题:functions - Why is my page feed returning empty content? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741522865a2383291.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论