wordpress
wordpress

wordpress 当自带MP4播放器无法满足 可以使用这个!

videojs-html5-player.zip

当自带MP4播放器无法满足 可以使用这个!
使用说明

[videojs_video url="http://example.com/wp-content/uploads/video/vid.mp4"]
You need to specify the location of a MP4 video file in the url parameter (H.264 encoded). This parameter is mandatory in order to embed a video using this plugin.

Video Demo
screenshot showing a demo of videojs html5 player for wordpress
Video Shortcode Options
Videojs plugin accepts a wide range of shortcode parameters that you can use to customize the video playback and controls.

WebM
“webm” parameter allows you to specify the location of a webm video file. For example:


[videojs_video url="http://example.com/wp-content/uploads/video/vid.mp4" webm="http://example.com/wp-content/uploads/video/vid.webm"]
Ogv
“ogv” parameter allows you to specify the location of a ogv video file. For example:


[videojs_video url="http://example.com/wp-content/uploads/video/vid.mp4" webm="http://example.com/wp-content/uploads/video/vid.webm" ogv="http://example.com/wp-content/uploads/video/vid.ogv"]
Width
“width” parameter allows you to set the width of the video. For example:


[videojs_video url="http://example.com/wp-content/uploads/video/vid.mp4" width="480"]
Controls
“controls” parameter allows you to show/hide video controls. By default video controls will be displayed. If set to “false” controls will be disabled. For example:

[videojs_video url="http://example.com/wp-content/uploads/video/vid.mp4" controls="false"]
Preload
“preload” parameter allows you to specify if and how a video should be loaded when the page loads.

“auto” – the video should be loaded entirely when the page loads (default)
“metadata” – only metadata should be loaded when the page loads
“none” – the video should not be loaded when the page loads
For example:

[videojs_video url="http://example.com/wp-content/uploads/video/vid.mp4" preload="metadata"]
Autoplay
“autoplay” parameter allows you to automatically play the video when the page is rendered. For example:

[videojs_video url="http://example.com/wp-content/uploads/video/vid.mp4" autoplay="true"]
Poster
“poster” parameter allows you to set a poster image for the video. For example:

[videojs_video url="http://example.com/wp-content/uploads/video/vid.mp4" poster="http://example.com/wp-content/uploads/poster.jpg"]
Loop
“loop” parameter allows for the looping of the video file (The video will start over again, every time it is finished). For example:

[videojs_video url="http://example.com/wp-content/uploads/video/vid.mp4" loop="true"]
Muted
“muted” parameter allows you to mute the audio output of the video. For example:
[videojs_video url="http://example.com/wp-content/uploads/video/vid.mp4" muted="true"]

timthumb.php文章缩略图出错修复

$_SERVER['DOCUMENT_ROOT'] = dirname(__FILE__);

在文件最上面添加这句就可以了!完美解决!但是本地的图片可能就无法显示了
报错提示一般是这些

A TimThumb error has occured
The following error(s) occured:
An error occured fetching image.

wordpress前台首页底部显示友情链接横排,去除标签

wordpress 3.5版本之后默认的都隐藏了后台友情链接管理,在主题文件 functions.php ,在最后的一行的 ?> 前面加入如下代码:

//开启wordpress友情链接管理
add_filter( 'pre_option_link_manager_enabled', '__return_true' );

我们在footer.php文件,在相应的位置添加上以下代码

<?php if (is_home()) { ?>
        <div id="footer_info"><span style="float:left;">友情链接:</span>
                <ul><?php wp_list_bookmarks('title_li=&categorize=0&orderby=name&show_images=0'); ?></ul>
        </div>
        <?php } else {?>
        <?php }
?>

在主题的 style.css 文件修改下样式,在最后加入以下代码:

/*友情链接样式*/
#footer{
        border-top:1px solid #ccc;
        margin-top:10px;
        padding-top:10px;
        overflow:hidden;
}
#footer_info{
        margin:0 auto;
        margin-bottom:5px;
        overflow:auto;
}
#footer_info ul{
        float:left;
        margin:2px; 
}
#footer_info li{
        list-style:none;
        float:left; 
        width:auto; 
        margin:0 5px;
}