【问题标题】:How do I disable WordPress showing XML content through attachment pages?如何禁用 WordPress 通过附件页面显示 XML 内容?
【发布时间】:2019-11-13 04:49:28
【问题描述】:

我们有一个 WordPress 网址,看起来像这样:http://www.example.com/blog/top-5-popular-news-in-usa/attachment/top-5-popular-news-in-usa/feed/,但它显示了下面的 xml 内容:

<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    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:media="http://search.yahoo.com/mrss/"
    >
<channel>
    <title>Comments on: top 3 popular news in usa/title>
    <atom:link href="http://www.example.com/blog/top-5-popular-news-in-usa/attachment/top-5-popular-news-in-usa/feed/" rel="self" type="application/rss+xml" />
    <link>http://www.example.com/blog/top-5-popular-news-in-usa/attachment/top-5-popular-news-in-usa/feed/</link>
    <description>News Management</description>
    <lastBuildDate>Tue, 02 Apr 2019 19:21:31 +0000</lastBuildDate>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <generator>https://wordpress.org/?v=4.9.1</generator>
</channel>
</rss>

它应该显示图像。请注意,我们网站上禁用了 Yoast SEO。

注意:您通过 WordPress 上传的每个项目——无论是图像、音频、视频还是其他任何内容——都可以有自己的页面和内容源

非常感谢任何帮助。谢谢。

【问题讨论】:

  • 为什么在 URL 的末尾使用/feed/?有什么特别的原因吗?

标签: javascript php html css wordpress


【解决方案1】:

为什么在 URL 的末尾使用 /feed/?有什么特别的原因吗?

我认为您可能有一个插件或设置将您重定向到该页面的 XML 版本。如果您不确定/feed/ 存在的原因,我建议您停用插件并检查页面/帖子以查看可能导致问题的原因。

在 WordPress 中,当 URL 添加 /feed/ 到末尾时,它将引用页面/帖子的 XML 数据。

【讨论】:

    猜你喜欢
    • 2011-07-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多