music短代码
音乐短代码music
该播放器使用了jwplayer播放器插件.下载请到 下面地址找.
- http://www.vgg.me/internet/flvhd-hd-video-short-code/
- http://www.vgg.me/internet/flv-video-short-code/
让你的wordpress博客也可以使用这样视频播放器, 首先打开主题中的functions.php
文件。如不存在此文件,创建一个。
在文件末尾, ?>
之前添加如下代码
//music播放器 function FLV_music($atts, $content=null){ return '<p style="text-align: center;"><embed wmode="Transparent" pluginspage=http://www.macromedia.com/go/getflashplayer src=/wp-content/plugins/mediaplayer-viral/player.swf width="350" height="24" type=application/x-shockwave-flash flashvars="file='.$content.'&backcolor=111111&frontcolor=eeeeee&stretching=exercise&displayheight=300&autostart=false" quality="high" allowFullScreen="true" allowscriptaccess="always" ></embed></p>'; } add_shortcode('music','FLV_music'); //music播放器
播放器长度,宽度可以自定义更改,建议跨度为24
,会完全显示播放器控件而不显示窗体.长度建议大于250
,太短不美观.
播放器文件安装
将下载的文件解压,然后将mediaplayer-viral文件夹上传的wordpress博客的wp-content/plugins
目录下
播放器使用格式(使用时请去除#)
在HTML编辑状态下使用如下格式(编写时请去除#)
[#music]music地址(mp3,wav等音乐文件地址)[#/music]
进阶设置
需要自定义长度的请使用如下代码:
//music播放器(自定义长度) function FLV_music($atts, $content=null){ extract(shortcode_atts(array("w"=>'0',),$atts)); return '<p style="text-align: center;"><embed wmode="Transparent" pluginspage=http://www.macromedia.com/go/getflashplayer src=/wp-content/plugins/mediaplayer-viral/player.swf width="'&w'" height="24" type=application/x-shockwave-flash flashvars="file='.$content.'&backcolor=111111&frontcolor=eeeeee&stretching=exercise&displayheight=300&autostart=false" quality="high" allowFullScreen="true" allowscriptaccess="always" ></embed></p>'; } add_shortcode('music','FLV_music'); //music播放器
需要打开页面自动播放时将autostart=false
该为autostart=true
重复播放在代码autostart=false
之后添加&repeat=always
编辑时切换到HTML模式(实际编辑时请去除#)
[#music w=350]music地址[#/music]
移动设备二维码阅读

┃文章档案信息: ┃本站文章除注明转载外,均为本站原创或编译
┃欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果,共创美好博客家园.
┃声明: 本文采用 BY-NC-SA ( 署名,非商业性使用,相同方式共享 )协议进行授权
┃转载请注明:转载来源自: 互联网新鲜事
┃本文标题: music短代码
┃本文网址: http://www.vgg.me/wordpress/music-short-code/

【上篇】:多说留言展示网址
【下篇】:豆瓣非官方FM客户端便携版本
Pingback: 百度云盘外链接口放送 – 互联网新鲜事