diff --git a/simple-rss.php b/simple-rss.php new file mode 100644 index 0000000..1b2f47c --- /dev/null +++ b/simple-rss.php @@ -0,0 +1,53 @@ + '', // RSS feed URL + 'items' => 5 // Number of items to display + ), + $atts, + 'simple_rss' + ); + + if (empty($atts['url'])) { + return '

No RSS feed URL provided.

'; + } + + $rss = fetch_feed($atts['url']); + + if (is_wp_error($rss)) { + return '

Unable to fetch the RSS feed.

'; + } + + $maxitems = $rss->get_item_quantity($atts['items']); + $rss_items = $rss->get_items(0, $maxitems); + + if ($maxitems == 0) { + return '

No items found in the RSS feed.

'; + } + + $output = ''; + + return $output; +} + +// Register the shortcode [simple_rss] +function simple_rss_shortcode() { + add_shortcode('simple_rss', 'simple_rss_display'); +} +add_action('init', 'simple_rss_shortcode'); diff --git a/simple-status.php b/simple-status.php deleted file mode 100644 index a92c3e7..0000000 --- a/simple-status.php +++ /dev/null @@ -1,16 +0,0 @@ -