Noscope is a bi-weekly journal serving up snacksized portions of pointless stuff since 2001. On a new linode server!
I also do freelance design and usability via dejligt.com

WordPress Trick: Google MP3 Player Shortcode

    16:59 on February 25, 2010 ,

Here’s another WordPress shortcode which is quite useful. It piggybacks on Googles excellent Flash-based MP3 player (the one they use in Gmail and so on), makes it easy to embed playable MP3s in your posts. Syntax: [mp3=path/to/filename.mp3]. Dump this in your functions.php:

function mp3player($attr) {
	$src = str_replace("=", "", $attr[0]);
	return '';
}
add_shortcode('mp3', 'mp3player');

Here’s an example:

Music by Speaker Bite Me.

Comment

Comments

  1. Hi. I have the theme Fauna in wordpress, and I see that you can use your own header. The problem is, I just don’t understand how to change the header picture? Could you help me with that ? (:

  2. Thx for this :)

  3. Thanks. That’s a pretty useful piece of code.

  4. Y5cafe says:

    Its simple but very useful

Leave a Reply

Have something to say? Jump right in!

(required)
(required)