Readlyte – Reading Time

外掛說明

Readlyte estimates how long it will take a visitor to read a post, based on its word count and a configurable words-per-minute rate, and displays it as a small badge.

Features

  • Automatic display before or after post content — no template edits required.
  • [rdlt_reading_time] shortcode for manual placement, including [rdlt_reading_time id="123"] for another post.
  • A “Reading Time (Readlyte)” Gutenberg block, server-rendered so it always matches your current settings.
  • An Elementor widget (when Elementor is active), with per-instance overrides for words-per-minute/text/icon and full Style tab controls (color, typography, icon gap).
  • Configurable words-per-minute, display text ({time} / {unit} placeholders), and which post types it applies to.
  • Word count strips HTML tags, shortcodes, and block-editor comments so the estimate reflects visible text only.
  • Theme-friendly: styled entirely with CSS classes and custom properties (--rdlt-color, --rdlt-icon-color, --rdlt-font-size, --rdlt-gap), so a theme can restyle the badge from its own stylesheet.
  • Developer filters: rdlt_word_count, rdlt_calculated_read_time, rdlt_read_time_text, rdlt_read_time_icon.

螢幕擷圖

適用於區塊編輯器

這個外掛提供 1 個可供區塊編輯器使用的區塊。

  • Reading Time (Readlyte) Displays the estimated reading time for this post.

安裝方式

  1. Upload the readlyte-reading-time folder to /wp-content/plugins/.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Go to Settings Readlyte to configure words-per-minute, display text, position, and enabled post types.

常見問題集

Can I place the read time somewhere specific in my template?

Yes. Set “Display mode” to “Shortcode / block only” in Settings Readlyte, then use the [rdlt_reading_time] shortcode or the “Reading Time (Readlyte)” block wherever you like, or call RDLT_Display::instance()->render_badge( $post_id ) directly in a theme template.

Does it work with Gutenberg and the Classic Editor?

Yes. The shortcode works with both. The block requires the block editor (Gutenberg / WordPress 5.8+).

How is word count calculated?

HTML tags, shortcodes, and block-editor comments are stripped before counting whitespace-separated words in the visible text.

Can I change the icon shown next to the read time?

Yes, with the rdlt_read_time_icon filter. Return your own HTML (inline SVG, a <i> icon-font tag, or an <img>), or return an empty string to remove the icon entirely.

// Swap in a Font Awesome icon.
add_filter( 'rdlt_read_time_icon', function( $icon, $post_id ) {
    return '<i class="fa-regular fa-clock" aria-hidden="true"></i>';
}, 10, 2 );

// Remove the icon.
add_filter( 'rdlt_read_time_icon', '__return_empty_string' );

The icon is sanitized with wp_kses (svg/path/circle/i/span/img only), so only presentational markup gets through.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈Readlyte – Reading Time〉的開發相關工作。

參與者

將〈Readlyte – Reading Time〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.0.0

  • Initial release as Readlyte (previously submitted under the name “Read Time Calculator”; renamed at the request of the WordPress.org Plugin Review Team for name distinctiveness — all identifiers, the shortcode tag, CSS classes, and the option name were updated accordingly).
  • Automatic display, [rdlt_reading_time] shortcode, Gutenberg block, and Elementor widget.
  • Developer filters: rdlt_word_count, rdlt_calculated_read_time, rdlt_read_time_text, rdlt_read_time_icon.