How can I add specific pages content to my sites RSS feed? As of right now the RSS feed automatically displays all of the sites posts content, but I want to add the RSS functionality to certain pages as well. Is there any way of doing this? Thank you.
How can I add specific pages content to my sites RSS feed? As of right now the RSS feed automatically displays all of the sites posts content, but I want to add the RSS functionality to certain pages as well. Is there any way of doing this? Thank you.
Share Improve this question asked Jun 11, 2019 at 16:34 scottwsmythscottwsmyth 12 bronze badges 1- RSS isn’t really for static content. It’s intended for a feed of updating content. Why do you need to add pages to it? – Jacob Peattie Commented Jun 11, 2019 at 16:39
1 Answer
Reset to default 0This is tested and works but you may get unexpected results.
function wpse_rss_pages($qv){
$rss_feed = array('post', 'page');
if(isset($qv['feed']) && !isset($qv['post_type']))
$qv['post_type'] = $rss_feed;
return $qv;
}
add_filter('request', 'wpse_rss_pages');
You could also seperate the feed by doing something like THIS.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745413295a4626629.html
评论列表(0条)