[WordPress] 外掛分享: Taro Ad Fields

WordPress 外掛 Taro Ad Fields 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Taro Ad Fields」是 2017-07-30 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2025-04-23,距離現在已有 11 天。
  • 外掛最低要求 WordPress 5.9 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

tarosky | yocchi161 | takahashi_fumiki |

外掛標籤

advertisement |

內容簡介

您可以為 WordPress 主題建立廣告位置。
在每個位置上,將顯示最新的廣告欄位。
您可以管理廣告的時間表和顯示!

從主題中

在您的主題中調用動作鉤:

', '

' ); ?>

在這個位置上,最新的廣告將被顯示。
使用Taro Clockwork Post外掛,您可以讓廣告自動過期。

鉤子引數

do_action( $hook_name, $slug, $before, $after );

$hook_name:動作鉤名稱。應為taro_ad_field。
$slug:位置的別名。
$before:廣告塊之前要輸出的字符串。如果沒有廣告,則不會顯示。
$after:廣告塊之後要輸出的字符串。

從小工具中

我們還有為廣告欄位提供的小工具。小工具中將顯示指定位置的最新廣告。

設置默認位置

在您的主題中,添加 taf_default_positions 過濾器鉤子。
這些術語將被自動創建。

add_filter( 'taf_default_positions', function() {
return [
'after-header' => [
'name' => 'After Header',
'description' => 'Displayed just after header.',
],
'after-content' => [
'name' => 'After Content',
'description' => 'Displayed just after content.',
'mode' => 'iframe',
],
];
} );

默認為空數組,因此沒有默認位置。
您可以像上面的過濾器鉤子一樣向其中添加新位置。
數組的結構將如下:

[
'slug_name' => [
'name' => 'Verbose Postion Name',
'description' => 'About where will be displayed(up to you)',
'mode' => 'iframe',
],
]

如果將模式設置為 ‘iframe’,則此位置將具有 URL,並在非常簡單的 HTML 頁面中顯示廣告。
您可以從管理屏幕的位置列表中的查看鏈接中獲取 URL。

此功能非常有用,可在其他平臺上交付廣告,例如Facebook Instant Article。

原文外掛簡介

You can create ad slot for you WordPress theme.
In each position, the latest ad field will be displayed.
You can manage your advertisement’s schedule & display!
From Theme
Call action hook in your theme:

', '

', 3 ); ?>

In this place, the latest 3 ads will be displayed.
With Taro Clockwork Post plugin, you can let your ad be automatically expired.
Hook Arguments
do_action( $hook_name, $slug, $before, $after, $number );>

$hook_name: The action hook name. Always should be taro_ad_field.
$slug: Slug of position.
$before: String to be output just before ad block. If no ad exists, this won’t be displayed.
$after: String to be output just after ad block.
$number: Number of ad to be displayed. Default is 1.
$contexts: Array of contexts. Context is a taxonomy that filters ads. For more details, see our Wiki.

From Widget
We also have widget for ad field. The latest ad of specified position will be displayed in the widget.
Set Default Positions
In your theme, add filter hook for taf_default_positions.
These terms will be created automatically.

add_filter( 'taf_default_positions', function() {
return [
'after-header' => [
'name' => 'After Header',
'description' => 'Displayed just after header.',
],
'after-content' => [
'name' => 'After Content',
'description' => 'Displayed just after content.',
'mode' => 'iframe',
],
];
} );

Defaults are empty array, so no default position.
You can add new position to them with filter hook like above.
The structure of array will be like below:

[
'slug_name' => [
'name' => 'Verbose Position Name',
'description' => 'About where will be displayed(up to you)',
'mode' => 'iframe',
],
]

If you set mode as ‘iframe’, this position will have URL and display ad in very simple HTML pages.
You can get URL from view link in position list of admin screen.
This feature is useful to deliver ad in external platform like Facebook Instant Article.

各版本下載點

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0.0 | 1.1.0 | 1.2.2 | 1.2.3 | 1.2.4 | 1.2.5 | 1.2.6 | 1.3.2 | 1.3.3 | 1.3.4 | 1.3.5 | trunk |

延伸相關外掛(你可能也想知道)

文章
Filter
Apply Filters
Mastodon