{"id":185,"date":"2016-06-27T09:00:59","date_gmt":"2016-06-27T14:00:59","guid":{"rendered":"https:\/\/crios.me\/?p=185"},"modified":"2022-01-08T10:56:48","modified_gmt":"2022-01-08T15:56:48","slug":"embed-sermonaudio-sermons-wordpress","status":"publish","type":"post","link":"https:\/\/crios.me\/embed-sermonaudio-sermons-wordpress\/","title":{"rendered":"How To Easily Embed SermonAudio Sermons In WordPress"},"content":{"rendered":"\n

SermonAudio.com<\/a> is a powerful media browser with tons of great content. It allows ministries to easily put their sermons online for the world to listen. SermonAudio handles everything from audio to video streaming across a huge range of platforms.<\/p>\n\n\n\n

Adding sermons to WordPress is a fairly simple task given WordPress\u2019 oEmbed API. Churches, bloggers, and ministries could easily take advantage of it and should. Sermons can be embedded as citations, as recommendations, or even just to keep the content in circulation.<\/p>\n\n\n\n

For the sake of this how-to I\u2019ll be showing you the easiest way to embed SermonAudio sermons. I won\u2019t go into the advanced process of creating widgets and shortcodes. I\u2019ll only show you how to make sermonaudio.com links embed audio sermons automatically.<\/p>\n\n\n\n

WordPress\u2019 oEmbed API<\/h2>\n\n\n\n

WordPress has had the oEmbed API since version 2.9. It has consistently been updated, and has added support for new default providers over time. Unfortunately SermonAudio is not on their list of default providers, but there\u2019s hope! The API itself is extendable so you are free to add your own providers if they\u2019re not natively supported.<\/p>\n\n\n\n

Using The API<\/h3>\n\n\n\n

oEmbed is a simple way to allow URLs to display embeddable content automatically. If you were to paste a link to a YouTube video in your post, WordPress would automatically get everything needed to display the video on your site.<\/p>\n\n\n\n

\"Greg<\/figure><\/div>\n\n\n\n

YouTube is only one example of a default provider, for a full list you can visit the WordPress codex<\/a>.<\/p>\n\n\n\n

Extend The API to Embed SermonAudio Sermons<\/h3>\n\n\n\n

Now lets try to achieve the same effect for SermonAudio content. In order for us to embed SermonAudio sermons we\u2019re going to need to register SermonAudio as a provider, and then provide WordPress with link to SermonAudio\u2019s sermon page.<\/p>\n\n\n\n

We can register the provider by hooking into the init action in WordPress and adding the provider below.<\/p>\n\n\n\n

add_action( 'init', function(){\n\twp_embed_register_handler();\n});<\/code><\/pre>\n\n\n\n

Now that we have the provider registered we need to provide it with a url. This should be the url that we would like to be embeddable. On a side note, we will be working with some regex to parse the url. As an example we\u2019ll use this sermon\u2019s url.<\/span><\/p>\n\n\n\n

\n