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; }{"id":38851,"count":0,"description":"","link":"https:\/\/theindustry.biz\/tag\/charles-warfield\/","name":"charles warfield","slug":"charles-warfield","taxonomy":"post_tag","meta":[],"_links":{"self":[{"href":"https:\/\/theindustry.biz\/wp-json\/wp\/v2\/tags\/38851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theindustry.biz\/wp-json\/wp\/v2\/tags"}],"about":[{"href":"https:\/\/theindustry.biz\/wp-json\/wp\/v2\/taxonomies\/post_tag"}],"wp:post_type":[{"href":"https:\/\/theindustry.biz\/wp-json\/wp\/v2\/posts?tags=38851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}