[WordPress] 外掛分享: Business Places

首頁外掛目錄 › Business Places
WordPress 外掛 Business Places 的封面圖片
10+
安裝啟用
尚無評分
1735 天前
最後更新
問題解決
WordPress 4.9.0+ PHP 5.6+ v2.2.1 上架:2017-06-04

內容簡介

這個外掛可以在你的 WordPress 網站上新增地點和開放時間。
先前名為「Taro Open Hour」。

支援 Google 地圖。
支援 JSON-LD。

案例研究

案例 1

如果你的網站是書店網站,可以新增你的商家地點。

這些地點和開放時間可以透過小工具顯示。

案例 2

如果你的網站是攀岩商店資料庫,可以選擇將文章類型設為地點。

每頁文章都有地點和開放時間的資訊。

如何顯示

小工具

你可以使用小工具來顯示開放時間和商業地點。

短代碼

你可以使用短代碼 [open-hour] 來顯示時間表。如果你是主題開發人員,
只需使用 tsoh_the_timetable() 函式即可。

對於商業地點,你可以使用 [business-place post_id='10']。
屬性 post_id 可以省略,預設值為目前文章。

致謝

橫幅圖像是日本地球空間情報部的作品。

自訂

以下是自訂項目的列表。

更改樣式

如果在你的主題資料夾中有檔案 tsoh-style.css,將會使用該檔案。
支援子佈景主題。

我們還有過濾器鈎子 tsoh_stylesheet。以下是更改 css 網址的範例。

get_stylesheet_directory_uri() . '/assets/css/table.css',
'version' => wp_get_theme()->get('Version'),
];
return $style;
});

如果在過濾器鈎子上返回 false,則不會載入樣式。

更改表格標記

時間表的範本位於 taro-open-hour/templates/time-table.php。
複製它到 your-theme/template-part/tsoh/time-table.php 並更改標記。

當然,你可以使用過濾器鈎子更改範本路徑。

// e.g. 如果文章類型是事件,則從預設值更改範本。
add_filter( 'tsoh_timetable_template_path', function( $path, $post ) {
if ( 'event' == $post->post_type ) {
$path = get_template_directory() . '/templates/yours/event.php';
}
return $path;
}, 10, 2 );

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.2.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Business Places」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin add places and open hours to your WordPress site.
Formerly known as “Taro Open Hour“.

Google Map supprted.
JSON-LD supported.

Case Study
Case 1
If your site is for your book store, add site location as your business place.
These location and open hour are available via widget.
Case 2
If your site is bouldering shop database, choose post type to be treated as location.
Each single page have place and open hour information.
How to display
Widgets
You can use widget for open our and business location.
Shortcodes
You can use shortcode [open-hour] for time table. If you are a theme developer,
just use tsoh_the_timetable() function.
For business places, you can use [business-place post_id='10'].
The attribute post_id can be omitted and it’s default value is current post.
Acknowledgements

Banner images is a deliverative of the work of the Geospatial Information Authority of Japan.

Customization
Here is a list of customizations.
Change Style
If you have tsoh-style.css in your theme folder, it will be used.
Child theme supported.
We also have filter hook tsoh_stylesheet. Below is the example to change css url.
get_stylesheet_directory_uri() . '/assets/css/table.css',
'version' => wp_get_theme()->get('Version'),
];
return $style;
});
If you returns false on filter hook, no style will be loaded.
Change table markup
Table’s template is located at taro-open-hour/templates/time-table.php.
Copy it to your-theme/template-part/tsoh/time-table.php and change markups.
Of course, you can change template path with filter hook.
// e.g. If post type is event, change template from default.
add_filter( 'tsoh_timetable_template_path', function( $path, $post ) {
if ( 'event' == $post->post_type ) {
$path = get_template_directory() . '/templates/yours/event.php';
}
return $path;
}, 10, 2 );

延伸相關外掛

文章
Filter
Mastodon