{"id":7669,"date":"2018-08-06T10:29:46","date_gmt":"2018-08-06T09:29:46","guid":{"rendered":"http:\/\/johnjohnston.info\/blog\/?p=7669"},"modified":"2018-08-06T10:29:46","modified_gmt":"2018-08-06T09:29:46","slug":"a-feed-for-my-microcast","status":"publish","type":"post","link":"https:\/\/johnjohnston.info\/blog\/a-feed-for-my-microcast\/","title":{"rendered":"A feed for my microcast"},"content":{"rendered":"<p>As part of my summer holiday fun with WordPress I though I might create a &#8216;proper&#8217; RSS feed for my <a href=\"http:\/\/johnjohnston.info\/blog\/category\/microcast\/\">microcast<\/a>.<\/p>\n<p>There are quite a few podcast plugins that would do the job but I though it might be interesting to try a bit of DIY.<\/p>\n<p>Back when I started a class podcast at <a href=\"http:\/\/www.sandaigprimary.co.uk\/radio_sandaig\/index.html\">Radio Sandaig<\/a> I used to create the RSS feed by hand with a text editor and a fair bit of copy and paste. Over at <a href=\"http:\/\/edutalk.info\">Edutalk<\/a> we use feedburner to massage the feed for iTunes.<\/p>\n<p>I used information from <a href=\"https:\/\/css-tricks.com\/roll-simple-wordpress-podcast-plugin\/\">How to Roll Your Own Simple WordPress Podcast Plugin | CSS-Tricks<\/a> to get me started with the template.<\/p>\n<p>I copied the <em>feed-rss2.php<\/em> file from the wp-includes folder to my child theme folder renaming it <em>feed-microcast.php<\/em><\/p>\n<p><em>wp-content\/themes\/sempress-child\/feed-microcast.php<\/em><\/p>\n<p>I adjusted the query to get the posts from my microcast category. I also hard coded the title, link, image and a few other things to simplify the process a little.<\/p>\n<p>I then used the template from CSS-Tricks as a guide to adding the various podcast tags to my template.<\/p>\n<p>This ended up with a pretty broken feed, mostly due to my lack of care, but I fixed it up later I got it linked up.<\/p>\n<p>I didn&#8217;t want to use the custom post type approach used in the article because that would involve editing all the old posts or converting them to the new type somehow.<\/p>\n<p>My first idea was to create a feed template and switch to that when the RSS feed for my microcast category was called for.<\/p>\n<p>After failing to get the template to switch for the standard category feed, <em>\/category\/microcast\/feed<\/em> I ended up with a custom feed at <em>\/feed\/microcast<\/em>.<\/p>\n<p>and I add<\/p>\n<pre><code>add_action('init', 'customRSS');\nfunction customRSS(){\n        add_feed('microcast', 'customRSSFunc');\n}\n\nfunction customRSSFunc(){\n        get_template_part('feed', 'microcast');\n}\n<\/code><\/pre>\n<p>to my functions.php file.<\/p>\n<p>I then spent a bit of time using the <a href=\"https:\/\/validator.w3.org\/feed\/check.cgi?url=Http%3A\/\/johnjohnston.info\/blog\/feed\/microcast\/\">W3C feed validation service<\/a> until I fixed the feed up to valadate.<\/p>\n<p>I&#8217;ve still got to get a link to the feed into the microcast category page head tag and I hope to do that as soon as I&#8217;ve gone a bit of research. For now I&#8217;ve a link in the sidebar.<\/p>\n<p>Here is the template: <a href=\"https:\/\/gist.github.com\/troutcolor\/d5e89e052e3658a74f59d3e82fc2ac09\">WordPress RSS feed template for my microcast<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of my summer holiday fun with WordPress I though I might create a &#8216;proper&#8217; RSS feed for my microcast. There are quite a few podcast plugins that would do the job but I though it might be interesting to try a bit of DIY. Back when I started a class podcast at Radio [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7626,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"mf2_syndication":[],"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"webmentions_disabled_pings":false,"webmentions_disabled":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[660,6],"tags":[766,54,48,11],"post_format":[],"class_list":{"0":"post-7669","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-micro","8":"category-wwwd","9":"tag-microcasting","10":"tag-podcasting","11":"tag-rss","12":"tag-wordpress","13":"kind-article","15":"h-entry","16":"hentry"},"better_featured_image":{"id":7626,"alt_text":"","caption":"","description":"","media_type":"image","media_details":{"width":1400,"height":1400,"file":"2018\/08\/ravenlogo-1400.png","sizes":{"thumbnail":{"file":"ravenlogo-1400-150x150.png","width":150,"height":150,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2018\/08\/ravenlogo-1400-150x150.png"},"medium":{"file":"ravenlogo-1400-620x620.png","width":620,"height":620,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2018\/08\/ravenlogo-1400-620x620.png"},"medium_large":{"file":"ravenlogo-1400-768x768.png","width":768,"height":768,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2018\/08\/ravenlogo-1400-768x768.png"},"large":{"file":"ravenlogo-1400-1024x1024.png","width":1024,"height":1024,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2018\/08\/ravenlogo-1400-1024x1024.png"},"post-thumbnail":{"file":"ravenlogo-1400-668x668.png","width":668,"height":668,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2018\/08\/ravenlogo-1400-668x668.png"},"sempress-image-post":{"file":"ravenlogo-1400-668x668.png","width":668,"height":668,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2018\/08\/ravenlogo-1400-668x668.png"},"rpwe-thumbnail":{"file":"ravenlogo-1400-45x45.png","width":45,"height":45,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2018\/08\/ravenlogo-1400-45x45.png"},"jetpack-portfolio-admin-thumb":{"file":"ravenlogo-1400-50x50.png","width":50,"height":50,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2018\/08\/ravenlogo-1400-50x50.png"}},"image_meta":{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0","keywords":[]}},"post":null,"source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2018\/08\/ravenlogo-1400.png"},"jetpack_featured_media_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2018\/08\/ravenlogo-1400.png","jetpack_shortlink":"https:\/\/wp.me\/p57zFQ-1ZH","jetpack_likes_enabled":false,"jetpack_sharing_enabled":true,"kind":false,"_links":{"self":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/7669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/comments?post=7669"}],"version-history":[{"count":2,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/7669\/revisions"}],"predecessor-version":[{"id":7671,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/7669\/revisions\/7671"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/media\/7626"}],"wp:attachment":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/media?parent=7669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/categories?post=7669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/tags?post=7669"},{"taxonomy":"post_format","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/post_format?post=7669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}