我在寻找一个WordPress插件,它只允许订阅者在feed中下载一个特定的文件。任何人都可以帮助我吗?订阅用户只下载功能
2
A
回答
0
基础上answer of Virgin,你基本上都首先要做的,就是让一个Feed templates,其位于/wp-includes/feed-myposttype.php 凡myposttype是你自定义文章类型名称 。
为了改变默认的RSS源,您将修改您所做的饲料myposttype.php模板,并重新定义了行动“do_feed_rss2”,就像这样:
remove_all_actions('do_feed_rss2');
add_action('do_feed_rss2', 'acme_product_feed_rss2', 10, 1);
function acme_product_feed_rss2($for_comments) {
$custom_type = 'myposttype'; //**your custom post type**
$rss_template = get_template_directory() . '/feeds/feed-myposttype.php';
if(get_query_var('post_type') == $custom_type and file_exists($rss_template))
load_template($rss_template);
else
do_feed_rss2($for_comments); // Call default function
}
另一种方法,是使用此逻辑评估Feed中的帖子是否为“特殊类别”的一部分,并启用仅针对该类别提及的下载功能。
0
您可以创建所谓的feed template,请参阅WordPress Codex部分,标题为“Customizing Feed Templates”,您将找到完整的说明。
相关问题
- 1. 订阅功能
- 2. iOS订阅应用功能
- 3. Google云端功能只能确认发布/订阅成功
- 4. 添加订阅和下载功能到Blogger
- 5. Pubnub PHP订阅功能
- 6. ReactiveCocoa:只订阅
- 7. 使用Wget下载整个RSS订阅
- 8. 杂志订阅程序的用户自定义功能
- 9. Firebase的云端功能 - 订阅用户到主题
- 10. drupal是否为用户提供了订阅管理功能?
- 11. CakePHP用户订阅
- 12. 订阅用户名?
- 13. 如何在淘汰赛中取消订阅订阅的功能?
- 14. Marionettejs - 如何取消订阅Vent功能订阅?
- 15. 在rails 3中取消订阅功能
- 16. 定制Knockout可订阅功能
- 17. 订阅角2中的功能
- 18. 条纹订阅附加的和功能
- 19. 撷取RSS订阅与Azure的功能
- 20. 无法订阅数据使用一个订阅功能在离子2
- 21. azure下载订阅文件链接
- 22. 下载xml文件RSS订阅Xamarin
- 23. 尝试与多用户订阅活动订阅并订购它
- 24. Facebook用户饲料订阅
- 25. 用户无法订阅pushpad
- 26. 检查用户订阅?
- 27. 具体到订阅用户
- 28. 你能解释一下Azure订阅吗?
- 29. Apple订阅客户
- 30. PDF下载功能
感谢您的回复。但我不明白如何实现它。 –