简体   繁体   English

为自定义帖子类型使用自定义元创建Wordpress的RSS源

[英]Create an RSS feed for Wordpress using custom meta for custom post types

I'm trying to find information on creating my own custom rss feed for my custom post types in Wordpress. 我正在尝试查找有关在Wordpress中为自定义帖子类型创建自己的自定义rss feed的信息。

The way I have set up my custom post types mean that the 'title' can be duplicated (although I fixed this for tags before anyone mentions it!). 我设置自定义帖子类型的方式意味着可以复制“标题”(尽管我在任何人提到它之前都已将其固定为标签!)。

Anyway, what I'm looking for is to display my title and custom meta for each of the feed's items but I just can't find any info. 无论如何,我正在寻找的是显示供稿每个项目的标题和自定义元,但我只是找不到任何信息。

Can anyone give me any ideas? 谁能给我任何想法?

Cheers 干杯

I actually found the answer quite easily... 我实际上很容易找到答案...

  1. Create a new template (ie feeds/my-new-feed.php) 创建一个新模板(即feeds / my-new-feed.php)
  2. Copy the code from wp-includes/feed-rss2.php into this new template 将代码从wp-includes / feed-rss2.php复制到此新模板中
  3. Do whatever it is you need to do to display whatever you want to. 做您需要做的以显示您想要的任何东西。
  4. Create a new page which uses that template 创建一个使用该模板的新页面

Hope this helps someone else. 希望这对其他人有帮助。

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

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