我正在寻找一个WordPress插件,只允许在饲料刻录机的订阅者下载一个特定的文件。有谁能帮我一下吗?
发布于 2012-10-03 06:29:14
基于answer of Virgin,您首先要做的基本上是创建一个Feed templates,它位于/wp-includes/feed-myposttype.php中,其中myposttype是您的自定义post类型名称。
为了更改默认的rss提要,您需要修改创建的feed-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
}另一种方法是使用此逻辑来评估提要中的帖子是否属于“特殊类别”,并仅为该类别启用您提到的下载功能。
发布于 2011-11-21 04:19:09
您可以创建所谓的feed template,请参阅标题为"Customizing Feed Templates“的WordPress Codex部分,您将找到完整的说明。
https://stackoverflow.com/questions/8204253
复制相似问题