function generate_rss_feed() { // Get all post categories $categories = get_categories(); // Create a new SimplePie object for the RSS feed $feed = new SimplePie(); $feed->set_feed_url(home_url('/rss')); $feed->set_title(get_bloginfo('name')); $feed->set_link(home_url()); $feed->set_description(get_bloginfo('description')); // Loop through each category and add posts to the feed foreach ($categories as $category) { // Only include published posts in the last 30 days $posts = get_posts([ 'post_type' => ['post'], 'post_status' => 'publish', 'numberposts' => 1000, // Adjust as needed 'category' => $category->term_id, 'date_query' => [ [ 'column' => 'post_date', 'after' => '30 days ago' ] ] ]); // Add items to the feed foreach ($posts as $post) { $item = new SimplePieItem(); $item->set_title($post->post_title); $item->set_link(get_permalink($post)); $item->set_content(apply_filters('the_content', $post->post_content)); $item->set_date(get_the_date(DATE_RSS, $post)); $feed->add_item($item); } } // Output the RSS feed $feed->handle_content_type(); exit; }{"version":"1.0","provider_name":"The Industry Dot Biz","provider_url":"https:\/\/theindustry.biz","title":"Radio Facts Top 25 PDs Vote NOW","type":"rich","width":600,"height":338,"html":"
Radio Facts Top 25 PDs Vote NOW<\/a><\/blockquote>