[WordPress] 外掛分享: KIA Subtitle

首頁外掛目錄 › KIA Subtitle
WordPress 外掛 KIA Subtitle 的封面圖片
8,000+
安裝啟用
★★★★★
5/5 分(18 則評價)
692 天前
最後更新
問題解決
WordPress 6.1+ v4.0.1 上架:2012-07-11

內容簡介

KIA字幕允許您輕鬆地添加標題,並以與文章標題相同的方式在循環中檢索它。透過使用the_subtitle() 或get_the_subtitle()。

它在文章、頁面和任何自訂文章類型的標題欄下方添加了一個簡單的輸入欄。它還將字幕列添加到編輯屏幕以及快捷編輯屏幕。

您還可以使用短碼[the-subtitle]在文章內容中顯示它。

在前端顯示字幕

這個外掛不會嘗試輸出字幕。由於有無限多的主題,我們不可能支援所有主題。使用者有責任相對應地自定義自己的主題。

這個外掛創建了一個the_subtitle()模板標籤,可以在您的主題模板中使用,如下所示:

if( function_exists( 'the_subtitle' ) ) the_subtitle();

您可以使用$ before和$ after參數將字符串包裝在某些標記中。

if( function_exists( 'the_subtitle' ) ) the_subtitle( '<h2 class="subtitle">', '</h2>' );

WooCommerce支援

您可以安裝和啟用一個小的橋接外掛,以自動在大多數易購地點顯示字幕。這將適用於使用WooCommerce的默認掛鈎的所有主題。

注:已知Ocean WP主題在WooCommerce模板中有自己的掛鈎。您需要修改橋接外掛...請參閱此支援主題。

WPML準備好了

KIA字幕已通過WPML測試,可讓您在多語言站點上翻譯字幕。

支援

支援在WordPress論壇中進行處理。請注意,支援是有限的,並且不包括外掛的任何自定義實現。

請將任何錯誤、錯誤、警告、代碼問題報告給Github

外掛標籤

開發者團隊

⬇ 下載最新版 (v4.0.1) 或搜尋安裝

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

原文外掛簡介

KIA subtitle allows you to add a subtitle to your posts and retrieve it in the loop in the same manner as the post title. By using the Subtitle block or the the_subtitle() or get_the_subtitle() template tags.
It adds an input field right under the title field of posts, pages and any custom post type. It also add a subtitle column to the edit screen as well as to the quick edit.
You can also use the Subtitle block or the shortcode [the-subtitle] to display it within the post content.
Site Editor
The plugin provides a Subtitle block in the editor. In the post editor, this doesn’t make a lot of sense, but mimics the core Title block. The ideal use case for the Subtitle block is when editing your theme

Click Edit Site in the WordPress toolbar
Select the template you wish to edit, commonly this might be called Single Post, or Singular.
Insert the Subtitle block where needed, commonly right after the Title block.

Template Tags
This plugin does not attempt to output the subtitle. With an infinite number of themes, it is not possible for us to support that. The onus is on the user to customize their theme accordingly. The plugin provides two template tags that can be used to customize your theme as desired.
`the_subtitle( string $before
”, string $after = ”, bool $display = true ): void|string` =
Displays or retrieves the current post subtitle with optional markup.
Parameters
$before `string` `optional`
Markup to prepend to the title.
Default: `''`

$after `string` `optional`
Markup to append to the title.
Default: `''`

$display `bool` `optional`
Whether to echo or return the title. Default true for echo.
Default: `true`

Example usage:
if ( function_exists( 'the_subtitle' ) ) the_subtitle( '

', '

' );

`get_the_subtitle( int|WP_Post $post ): string`
Retrieves the post subtitle.
Parameters
$post `int|WP_Post` `optional`
Post ID or WP_Post object.
Default: global `$post` object.

`
WooCommerce support
There is a small bridge plugin you can install and activate to automatically display the subtitle in most WooCommerce locations. This will work for all themes that are using WooCommerce’s default hooks.
NB: It’s known that the Ocean WP theme has it’s own hooks in the WooCommerce templates. You will need to alter the bridge plugin… please take a look at this support thread.
WPML Ready
KIA Subtitle has been tested by WPML and will allow you to translate the subtitle on multilingual sites.
Support
Support is handled in the WordPress forums. Please note that support is limited and does not cover any custom implementation of the plugin.
Please report any bugs, errors, warnings, code problems to Github

延伸相關外掛

文章
Filter
Apply Filters
Mastodon