
內容簡介
影片和圖片不必困難。Gabfire 主題包括了一個媒體模組,使嵌入媒體變得簡單。
這個外掛由 http://www.gabfirethemes.com 的團隊維護。
我們強烈建議您與
https://wordpress.org/plugins/otf-regenerate-thumbnails/ 配合使用
範例程式碼
<?php
gabfire_media(array(
'name' => 'figure',
'imgtag' => 1,
'link' => 1,
'enable_thumb' => 1,
'enable_video' => 0,
'resize_type' => 'c',
'media_width' => 415,
'media_height' => 284,
'thumb_align' => 'alignnone',
'enable_default' => 1,
'default_name' => 'defaultimage.png'
));
?>
name -> 要使用的文章縮略圖名稱,將被調整大小以顯示特色圖片
imgtag -> 1 或 0。使用此選項可以添加/刪除到圖像的 ‘<img src’ 標籤。
link -> 1 或 0。如果設置為 1,圖像將有一個連接到文章的連結
enable_thumb -> 1 或 0。您可能只想使用此選項功能以獲取特色文章縮略圖
enable_video -> 1 或 0。您可能只想使用此選項功能來獲取影片
resize_type -> c、w 或 h。C 會裁剪圖像到完全大小。w 調整寬度並按比例計算高度。h 調整高度並按比例計算寬度。
thumb_align -> 將一個類添加到媒體
enable_default -> 1 或 0。如果文章沒有媒體,您可以設置一個默認圖像來顯示
default_name -> 要顯示的圖像名稱。圖像路徑是 yourtheme/images/thumbs 目錄。
如何嵌入影片
如果您要使用 Youtube/Vimeo/Dailymotion -> 從瀏覽器欄中複製影片 URL -> 使用鍵名 iframe 將其添加到自定義欄位中的文章中
如果您想顯示自托管的 MP4、WEBM 或 OGV 檔案,請按以下方式添加它們
自定義欄位鍵名 video-mp4,並將完整檔案 URL 輸入值欄位
自定義欄位鍵名 video-webm,並將完整檔案 URL 輸入值欄位
自定義欄位鍵名 video-ogv,並將完整檔案 URL 輸入值欄位
要向影片添加字幕(SRT 或 VTT 格式),請使用自定義欄位名稱 caption-url-1,並將完整檔案 URL 輸入值欄位
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
Videos and pictures don’t have to be difficult. Gabfire themes include a media module that makes embedding media simple.
This plugin is maintained by the folks over at http://www.gabfirethemes.com
We strongly suggest you to use this plugin together with
Sample Code
'figure',
'imgtag' => 1,
'link' => 1,
'enable_thumb' => 1,
'enable_video' => 0,
'resize_type' => 'c',
'media_width' => 415,
'media_height' => 284,
'thumb_align' => 'alignnone',
'enable_default' => 1,
'default_name' => 'defaultimage.png'
));
?>
name -> Name of post thumbnail to be used thats going to be resized to display featured image
imgtag -> 1 or 0. Using this option you can add/remove ‘ 1 or 0. If set 1, the image will have a link to post
enable_thumb -> 1 or 0. You may want to use this option function just to get featured post thumbnails
enable_video -> 1 or 0. You may want to use this option function just to get videos
resize_type -> c, w, or h. C will crop image to exact size. w resizes the width and calculates height in proportion. h resizes the height and calculates width in proportion.
thumb_align -> adds a class to media
enable_default -> 1 or 0. You can set a default image to display if post has no media
default_name -> name of image to display. The image path is yourtheme/images/thumbs directory.
How to Add a Video
If you are going to use Youtube/Vimeo/Dailymotion -> copy video URL from browser bar -> add it via custom field to your post using key name iframe
If you’d like to display a self hosted MP4, WEBM or OGV file, add them as below
Custom field key name video-mp4 and enter full file url into value field
Custom field key name video-webm and enter full file url into value field
Custom field key name video-ogv and enter full file url into value field
To add a caption (SRT or VTT format) to the video, use custom field name caption-url-1 and full file url into value field
