给WordPress添加FLV播放器

实现方法:

  1. 下载 flvplayer.swf 播放器:http://www.hzlzh.com/up/flvplayer.swf
  2. 把播放器放到 当前使用主题目录  即 wp-content/theme/****;
  3. 在主题的 functions.php 中添加如下代码即可;
/**FLV player */
function flvplayer($atts, $content=null){
extract(shortcode_atts(array("width"=>'460',"height"=>'330'),$atts));
return '<embed width="'.$width.'" height="'.$height.'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" allowfullscreen="true" src="'.get_bloginfo("template_url").'/flvplayer.swf?IsAutoPlay=0&IsContinue=1&BarPosition=1&IsShowBar=1&vcastr_file='.$content.'">
';}
add_shortcode('mv','flvplayer');

以后写文章的时候,调用使用[m v] [/m v]标签,当然可以传出尺寸的参数  即 [m v width=”600″ height=”300″]  url [/m v]

思章老师

认准了方向,就要勇敢地走下去,十年磨一剑,我相信,只要坚持,一切都有可能。

相关日志

  1. 没有图片

    2010.11.30

    菠萝筐添加Google Adsense广告

    菠萝筐已经很久没添加Google Adsen…

  2. 没有图片

    2010.08.16

    WordPress 3.0.1 官方中文版终于发布

    自从WordPress2.9.2中文版发布之…

  3. 没有图片

    2010.06.28

    WordPress Post Thumbnail 文章缩略图功能教程

    WordPress主要是为博客而来的,但如果…

  4. 没有图片

    2011.01.24

    改变WordPress后台日志列表显示数量的办法

    老版本的WordPress后台每页日志列表数…

  5. 没有图片

    2011.04.21

    Windows XP死亡倒计时小工具

    Windows XP、Internet Ex…

  6. 没有图片

    2010.05.18

    Ajax Comments-Reply 让你的博客无刷新嵌套评论

    虽然我的博客已经实现了嵌套评论,但还是觉得不…

评论

还没有评论。