{"id":14,"date":"2008-08-19T20:54:21","date_gmt":"2008-08-20T04:54:21","guid":{"rendered":"http:\/\/kevware.wordpress.com\/?p=36"},"modified":"2011-03-26T23:14:08","modified_gmt":"2011-03-27T07:14:08","slug":"php-code-share-rss-blog-feeds-on-your-website","status":"publish","type":"post","link":"https:\/\/www.kevware.com\/geek\/php-code-share-rss-blog-feeds-on-your-website\/","title":{"rendered":"PHP Code Share:  RSS Blog Feeds on your website"},"content":{"rendered":"<p>I don&#8217;t have much time today, so I&#8217;ll tackle a smaller topic as opposed to the larger &#8220;site search&#8221;\u00a0 I was going to take on. \ud83d\ude09\u00a0 This is just as valuable for a site nowadays though, so hopefully others can be spared a little bit of headache with this info.<\/p>\n<p>Everyone and their mama, papa, and siblings have a blog these days.\u00a0 And others like myself have a website in addition to that.\u00a0 So the logical next step for me was how do I include my latest blog entries into my personal website.\u00a0 It may seem simple (and actually kind of is pretty simple), but not so much when you try to Google a solution.\u00a0 Mostly you come up with services that promise to give you code to include on your site that they generate for you once you join, pay, or give an email address.\u00a0 Most of the ones I tried were pretty crappy.\u00a0 And then there was that lovely link to their site at the bottom that you coudn&#8217;t disable.\u00a0 ICK!!!<\/p>\n<p>Finally I went to RSS2HTML.\u00a0 It had come up on my Google results but I hadn&#8217;t really checked it out.\u00a0 Well after some pretty crappy include code I got over myself and downloaded the free version.\u00a0 It claimed to be simple but the documentation was kind of confusing.\u00a0 The main point of confusion was assuming you needed an xml file to point to for the script to work.\u00a0 WordPress provides a URL but not necessarily an XML file for that purpose.\u00a0 I\u00a0 finally put the url into the rss2html.php file for the xml location:<br \/>\n$XMLfilename = &#8220;http:\/\/kevware.wordpress.com\/feed\/&#8221;;<\/p>\n<p>Uploaded everything, then loaded the template file in my web browser from my live site (none of this works when using localhost&#8230; at least it didn&#8217;t for me).\u00a0 Voila!\u00a0 There it all was as I had hoped.\u00a0 Kind of jacked up looking and badly in need of styles and formatting, but it was all there.<\/p>\n<p>There are only three files you need to make this work:\u00a0 the template file, the parser file, and the rss2html.php file.\u00a0 If you make your template a php file, you can add it as an include to your php page.\u00a0 I wouldn&#8217;t recommend that though.\u00a0 Because of how it pulls from the rss2html file it can really jack up your existing page when previewed in DW or even when posted.\u00a0 I got around this issue by putting it into an iframe on my homepage.\u00a0 And that solved the rendering problems.\u00a0 Once I got it up and running (and tweaked as much as needed to look the way I wanted) I felt silly for how much time I had put into hunting down other &#8220;easier&#8221; solutions.\u00a0 This one may not have seemed easy at first when I went to their home page, but it turned out to be exactly what I wanted&#8230; and needed!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I don&#8217;t have much time today, so I&#8217;ll tackle a smaller topic as opposed to the larger &#8220;site search&#8221;\u00a0 I was going to take on. \ud83d\ude09\u00a0 This is just as valuable for a site nowadays though, so hopefully others can be spared a little bit of headache with this info. Everyone and their mama, papa, &#8230; <span class=\"more\"><a class=\"more-link\" href=\"https:\/\/www.kevware.com\/geek\/php-code-share-rss-blog-feeds-on-your-website\/\">[Read more&#8230;]<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,4],"tags":[],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-admin","4":"post-14","6":"format-standard","7":"category-php-code-share","8":"category-php-code"},"_links":{"self":[{"href":"https:\/\/www.kevware.com\/geek\/wp-json\/wp\/v2\/posts\/14","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kevware.com\/geek\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kevware.com\/geek\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kevware.com\/geek\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kevware.com\/geek\/wp-json\/wp\/v2\/comments?post=14"}],"version-history":[{"count":1,"href":"https:\/\/www.kevware.com\/geek\/wp-json\/wp\/v2\/posts\/14\/revisions"}],"predecessor-version":[{"id":93,"href":"https:\/\/www.kevware.com\/geek\/wp-json\/wp\/v2\/posts\/14\/revisions\/93"}],"wp:attachment":[{"href":"https:\/\/www.kevware.com\/geek\/wp-json\/wp\/v2\/media?parent=14"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kevware.com\/geek\/wp-json\/wp\/v2\/categories?post=14"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kevware.com\/geek\/wp-json\/wp\/v2\/tags?post=14"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}