简体   繁体   English

区分类别与 Wordpress RSS 提要中的标签

[英]Differentiate categories from tags in a Wordpress RSS feed

I have a wordpress blog with an automatic generated rss feed ( https://blog.pixelinnova.com/feed ), but I can't find a way to differentiate the categories from the tags, they are all between the XML tags <category></category> .我有一个带有自动生成的 RSS 提要( https://blog.pixelinnova.com/feed )的 wordpress 博客,但我找不到区分类别和标签的方法,它们都在 XML 标签<category></category> For example:例如:

<category><![CDATA[Consultoría tecnológica]]></category>
<category><![CDATA[Marketing digital]]></category>
<category><![CDATA[centennials]]></category>
<category><![CDATA[facebook]]></category>

The two first ones are categories, the others are tags.前两个是类别,其他是标签。

Is there a way that I can make them look different in the feed, like changing the tags' "category" XML tag or something?有没有办法让它们在提要中看起来不同,比如更改标签的“类别”XML 标签或其他什么?

示例图像

The ones marked in yellow are categories.黄色标记的是类别。 The others are tags.其他都是标签。

I found a snippet that makes only categories appear on the feed, I added it to the functions.php on my child theme and it worked:我找到了一个片段,它只在提要上显示类别,我将它添加到我的子主题的 functions.php 中,并且它起作用了:

add_filter('get_the_tags', 'strip_tags_from_feeds');
function strip_tags_from_feeds($terms) {
if (is_feed())
  return array();
  return $terms;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM