RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.20% (5.24%*) • Home Loan Fixed: 5.48% (6.24%*) • Fixed: 5.48% (6.24%*) • Variable: 5.20% (5.24%*) • Investment IO: 5.78% (6.81%*) • Investment PI: 5.49% (6.32%*)

Embed an Omny.fm Audio Player With WordPress Shortcode

Embed an Omny.fm Audio Player With WordPress Shortcode

Omny.fm is a high-end podcast and audio hosting service with integrated player analytics. It's a premium service typically used by radio stations and other audio professionals because of a range of features that permits editing, live cloud capture, and audience analytics. While not typically used by your everyday podcaster, there are times when you might integrate the player into your WordPress website, and this article provides the necessary code to achieve that end.

Note: OmnyStudio is now used as the default podcast player in Yabber Tag: yabber. Read about the Omny integration here. Yabber includes an Elementor block for drag-and-drop functionality.

As with any embed code, shortcode is almost always a better alternative to raw embed code because of the ease of which global player changes can be made (changing the shortcode alters each occurrence of the player on your website).

The Result

I've referenced an audio clip from Alan Jones' radio program in our examples (and for no particular reason except it was the first I found). I've also truncated the URL for page formatting purposes.

The player renders in three flavours:

artwork (default)

Shortcode of [omny url="https://omny.fm/show .. d-with"] returns the following:

cover

Shortcode of [omny url="https://omny.fm/show .. d-with" style="cover"] returns the following:

square

Shortcode of [omny url="https://omny.fm/show .. d-with" style="square"] returns the following:

WordPress Shortcode

Copy and paste the WordPress function into your theme's functions.php file or, if you sensibly have one installed, your custom functions plugin.

1
<?php 
2
/*
3
 Embed an Omny.fm Audio Player With WordPress Shortcode
4
 https://www.beliefmedia.com.au/embed-omnyfm-wordpress
5
*/
6
 
7
function beliefmedia_omnystuidio($atts) {
8
 
9
 $atts = shortcode_atts(array(
10
  'url' => '', /* Omny.fm Clip URL */
11
  'width' => '540',
12
  'style' => 'artwork' /* artwork, cover, or square */
13
 ), $atts);
14
 
15
 /* URL Required */
16
 if ($atts['url'] == '') return 'The omny.fm audio URL is required.';
17
 
18
 /* Adjust standard heights & style */
19
 $style = ($atts['style'] == 'square') ? 'cover&size=square' : $atts['style'];
20
 $height = ($atts['style'] == 'square') ? $atts['width'] : '180';
21
 
22
 return '<div style="text-align: center; max-width:' . $width . ';"><iframe src="' . rtrim($atts['url'], '/') . '/embed?style=' . $style . '&" frameborder="0" width="' . $atts['width'] . '" height="' . $height . '"></iframe></div>';
23
}
24
add_shortcode('omny', 'beliefmedia_omnystuidio');

If you require shortcode to work in a sidebar widget, you'll have to enable the functionality with a filter. If you're using our custom functions plugin, you'll have that feature enabled by default.

Shortcode Attributes

The following attributes are available to alter the appearance of the player.

url

The page URL of the audio clip.

width

We've wrapped the player in a container to avoid the player stretching to 100% by default. Alter the width to your liking. If using a square player, the height will inherit your width.

type

Available player types are artwork (default), cover, or square (as shown above)

Considerations

Omny has an API that provides some seriously funky features . We'll be sharing some features of the API sometime soon via the tag of omny Tag: omny

Download


Title: Show OmnyStudio Podcast Player in WordPress with Shortcode
Description: Show OmnyStudio Podcast Player in WordPress with Shortcode. The BeliefMedia plugin supports a drag-and-drop Elementor block to support the player, and includes detailed podcast statistics.
  Download • Version 0.1.1, 670.0B, zip, Category: WordPress Shortcodes

Download our 650-page guide on Finance Marketing. We'll show you exactly how we generate Billions in volume for our clients.

  E. Australia Standard Time [ UTC+10, Default ] [ CHECK TO CHANGE ]

  Want to have a chat?
 

RELATED READING

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment