[WordPress] 外掛分享: Gallery One

首頁外掛目錄 › Gallery One
WordPress 外掛 Gallery One 的封面圖片
50+
安裝啟用
尚無評分
3579 天前
最後更新
問題解決
WordPress 4.5+ v1.0.2 上架:2016-05-23

內容簡介

查看示範:http://shrimp2t.com/gallery-one/

功能

完全響應式,支援觸控
無限相簿
無限圖片
旋轉木馬
網格模式
比例排版模式
瀑布流模式
幻燈片模式
博客風格(即將推出)
JustifiedGallery 燈箱
載入 Facebook 相簿中的圖片
載入 Flickr 相簿中的圖片
從 URL 新增圖片
建立短碼

載入 Facebook 相簿

只需貼上您的相簿 URL,例如:

https://www.facebook.com/BillGates/photos/?tab=album&album_id=10153110017351961

注意:要載入相簿,您的相簿必須是公開的。

載入 Flickr 相簿

只需貼上您的相簿 URL,例如:

The Wheel

注意:要載入相簿,您的相簿必須是公開的。

在您的佈景主題中新增自訂視圖

在您的佈景主題中建立資料夾 gallery-one。
在建立的資料夾中加入一個檔案,並命名為 view.php。
[選擇性] 在建立的資料夾中加入一個檔案,並命名為 config.php。

範例檔案 view.php:

<div class="my-view">
<?php
var_dump( $this->settings ); /* 在 config.php 檔案中設定的資料
var_dump( $this->media->get_data() ); // 相簿項目的資料
?>
</div>

範例檔案 config.php:

$config = array(
'name' => __( 'Justified', 'gallery-one' ), // 視圖名稱
'js' => 'js/js.js',
'css' => 'css/css.css',
'view_settings' => array(
array(
'id' => 'margins',
'default' => '10',
'label' => __( 'Margins', 'gallery-one' ),
'type' => 'text'
),
array(
'id' => 'lightbox',
'default' => '1',
'label' => __( 'Lightbox', 'gallery-one' ),
'type' => 'checkbox'
),

),
);

在 WordPress 外掛中新增自訂視圖

在您的外掛中建立新資料夾,例如: my-cool-views。
新增新的視圖資料夾,例如: my-cool-views/full-screen。
為您的視圖新增 view.php 檔案,位於 my-cool-views/full-screen/view.php。
[選擇性] 為您的視圖新增 config.php 檔案,位於 my-cool-views/full-screen/config.php。

將您的視圖資料夾加入到視圖載入器中:

add_filter( ‘gallery_one_get_template_folders’, ‘my_cool_views_path’);

function my_cool_views_path( $view_paths ){
$view_paths[‘my_cool_view’] = PATH_TO_MY_PLUGIN.’/my-cool-views’;
return $view_paths;
}

參數設定

name: (string) 您視圖的名稱。

css: (string/array) 每當載入此視圖時,會併入 CSS 檔案。

js: (string/array) 每當載入此視圖時,會併入 JS 檔案。

view_settings:(array) 列出您視圖的欄位設定。

view_settings 參數:

id:欄位設定的 ID。
label:欄位設定的標籤。
default:預設值。
type:欄位類型:text|select|checkbox|textarea。
option:針對 select 欄位類型(陣列)。
desc:欄位設定的描述。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Gallery One」→ 直接安裝(推薦)

原文外掛簡介

See demo: http://shrimp2t.com/gallery-one/

Features

Fully responsive, Touch enabled
Unlimited albums
Unlimited images
Carousel
Gird
Justified
Masonry
Slideshow
Blog style (comming soon )
JustifiedGallery Light box
Load Facebook album images
Load Flickr album images
Add image from url
Shortcode creator

Load Facebook Album
Just paste your album url, example:
https://www.facebook.com/BillGates/photos/?tab=album&album_id=10153110017351961

Note: Your album status must be public to load.
Load Flickr Album
Just paste your album url, example:
The Wheel

Note: Your album status must be public to load.
Adding your own view in your theme

Create a folder gallery-one on your theme.
Inside folder which created add a file and name view.php
[Optional] Inside folder which created add a file and name config.php

Example file view.php:

settings ); /* You config data in file config.php
var_dump( $this->media->get_data() ); // Gallery items data
?>

Example file config.php:
$config = array(
'name' => __( 'Justified', 'gallery-one' ), // view name
'js' => 'js/js.js',
'css' => 'css/css.css',
'view_settings' => array(
array(
'id' => 'margins',
'default' => '10',
'label' => __( 'Margins', 'gallery-one' ),
'type' => 'text'
),
array(
'id' => 'lightbox',
'default' => '1',
'label' => __( 'Lightbox', 'gallery-one' ),
'type' => 'checkbox'
),

),
);

Adding your own view in your plugin

Create new folder in your plugin, example: my-cool-views.
Add add new view folder example: my-cool-views/full-screen.
Add view.php file for you view my-cool-views/full-screen/view.php.
[Optional] Add config.php file for you view my-cool-views/full-screen/config.php.

Add your your views folder to view loader:
add_filter( ‘gallery_one_get_template_folders’, ‘my_cool_views_path’);
function my_cool_views_path( $view_paths ){
$view_paths[‘my_cool_view’] = PATH_TO_MY_PLUGIN.’/my-cool-views’;
return $view_paths;
}

Config Parameters
name: (string) Name of your view.
css: (string/array) CSS files will enqueue when this view load.
js: (string/array) JS files will enqueue when this view load.
view_settings: (array) list field settings for your view.
view_settings Parameters:

id: Id of setting field.
label: Label of setting files.
default: Default value.
type: Field type: text|select|checkbox|textarea.
option: For field type select (array).
desc: Field description.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon