Method 1:
1. Add: Copy the following code to functions. php (note that it is in the php loop), and then download the example
The code is as follows: |
Copy code |
Function mp3player ($ atts, $ content = null ){ Extract (export code_atts (array ("auto" => '0'), $ atts )); Return '<embed src = "'. get_bloginfo (" template_url "). '/mp3player.swf? Url = '. $ content. '& amp; autoplay = '. $ auto. '"type =" application/x-shockwave-flash "wmode =" transparent "allowscriptaccess =" always "width =" 400 "height =" 30 "/> '; } Add_playback code ('mp3', 'mp3player '); |
2. Use: When writing an article, insert the following format code in "HTML (text) mode".
The code is as follows: |
Copy code |
[Mp3 auto = "0" vol = "60"] MP3 file URL [/mp3] |
The above code: auto: whether to play automatically (0 or 1); vol: volume (1 ~ 100)
Effect:
Method 2:
1. Copy the following code to functions. php (note that it is in the php loop), and then download the example.
The code is as follows: |
Copy code |
/** Add flash player */ Function myplayer ($ atts, $ content = null ){ Extract (export code_atts (array ("auto" => 'no', "loop" => 'no'), $ atts )); Return '<embed src = "'. get_bloginfo (" template_url "). '/player.swf? SoundFile = '. $ content. '& bg = 0 xeeeeee & leftbg = Mirror & lefticon = 0 xFFFFFF & rightbg = Mirror & rightbghover = 0xaf2910 & righticon = 0 xffffffff & expires = 0 xFFFFFF & text = 0x666666 & slider = 0x666666 & track = 0 xFFFFFF & border = 0x666666 & loader = 0x9FFFB8 & loop = '. $ loop. '& autostart = '. $ auto. '"type =" application/x-shockwave-flash "wmode =" transparent "allowscriptaccess =" always "width =" 290 "height =" 30 "/> '; } Add_audio code ('Music', 'myplayer '); |
2. Use: When writing an article, insert the following format code in "HTML (text) mode".
The code is as follows: |
Copy code |
[Music] MP3 file URL [/music] |
You can set the color of the player on your own. You can modify the color code on the top and try it on your own.
The effect is as follows: