{"id":34751,"date":"2010-07-01T19:04:32","date_gmt":"2010-07-01T23:04:32","guid":{"rendered":"http:\/\/wpmu.org\/?p=34751"},"modified":"2013-06-13T21:13:40","modified_gmt":"2013-06-14T01:13:40","slug":"daily-tip-how-to-embed-rss-feed-entries-in-wordpress-posts","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/daily-tip-how-to-embed-rss-feed-entries-in-wordpress-posts\/","title":{"rendered":"How to Embed RSS Feed Entries in WordPress Posts"},"content":{"rendered":"<p>If you want to list some of the latest posts from another site within one of your WordPress posts or pages, here&#8217;s a handy way to do it using a shortcode.<\/p>\n<p>First, add this to your <i>functions.php<\/i> file:<\/p>\n<pre>\/\/This file is needed to be able to use the wp_rss() function.\r\ninclude_once(ABSPATH.WPINC.'\/rss.php');\r\n\r\nfunction readRss($atts) {\r\nextract(shortcode_atts(array(\r\n\"feed\" =&gt; 'http:\/\/',\r\n\"num\" =&gt; '1',\r\n), $atts));\r\n\r\nreturn wp_rss($feed, $num);\r\n}\r\n\r\nadd_shortcode('rss', 'readRss');<\/pre>\n<p>After adding that you can now use a shortcode to embed RSS:<\/p>\n<p><code>[rss feed=\"https:\/\/wpmudev.com\/blog\/feed\" num=\"5\"]<\/code><\/p>\n<p>It will look a little something like this:<br \/>\n<a rel=\"lightbox[34751]\" class=\"blog-thumbnail\" href=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2010\/07\/rss.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-34752\" title=\"rss\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2010\/07\/rss.png\" alt=\"Post image\" aria-hidden=\"true\" width=\"640\" height=\"199\" \/><\/a><\/p>\n<p style=\"font-size: 12px;\">Source: <a href=\"http:\/\/www.catswhocode.com\/blog\/10-incredibly-cool-wordpress-shortcodes\" target=\"_blank\">CatsWhoCode.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to list some of the latest posts from another site within one of your WordPress posts or pages, here&#8217;s a handy way to do it using a shortcode. First, add this to your functions.php file: \/\/This file is needed to be able to use the wp_rss() function. include_once(ABSPATH.WPINC.&#8217;\/rss.php&#8217;); function readRss($atts) { extract(shortcode_atts(array( [&hellip;]<\/p>\n","protected":false},"author":4099,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[263],"tags":[803],"tutorials_categories":[],"class_list":["post-34751","post","type-post","status-publish","format-standard","hentry","category-tutorials","tag-rss"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/34751","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/4099"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=34751"}],"version-history":[{"count":1,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/34751\/revisions"}],"predecessor-version":[{"id":183120,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/34751\/revisions\/183120"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=34751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=34751"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=34751"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=34751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}