零贰'Blog

零贰'Blog - 记录日常点点滴滴..........

给WordPress添加Mini Flash播放器

Wordpress

转载自【自力博客】:

1、下载flash播放器: 然后上传到 wp-content/theme/主题目录/

2、在Wordpress 在用主题的 functions.php 中间位置添加如下函数:

/**添加 flash player */ function myplayer($atts, $content=null){ extract(shortcode_atts(array("auto"=>'no',"loop"=>'no'),$atts)); return '<embed src="'.get_bloginfo("template_url").'/player.swf?soundFile='.$content.'&bg=0xeeeeee&leftbg=0x357dce&lefticon=0xFFFFFF&rightbg=0xf06a51&rightbghover=0xaf2910&righticon=0xFFFFFF&righticonhover=0xffffff&text=0x666666&slider=0x666666&track=0xFFFFFF&border=0x666666&loader=0x9FFFB8&loop='.$loop.'&autostart='.$auto.'" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" width="290" height="30">'; } add_shortcode('music','myplayer');

代码调用:[music]音乐绝对地址[/music] 

 

效果预览:

[music]http://www.cool02.com/0ther/错的都是我.mp3[/music]