跳到内容

Tivy Popular Posts

v1.0.4

tivy · 2026年11月27日 上架

Show your most-read posts and pages, with private view counting: no cookies, no IP addresses, no external services.

正在使用
10 以下
评分
暂无
累计下载
26
最近更新
2026年11月27日
需要 WordPress 6.3+已测试到 7.2PHP 7.4+

贡献者

Missing the Top Posts list from Jetpack? Tivy Popular Posts counts views on your own site and shows your most-read posts as a numbered list, in a sidebar, under an article or on a “best of” page.

Private by design

  • No cookies, no IP addresses, no browser details stored
  • Only a daily total per post is kept, nothing about the visitor
  • No external services: everything stays in your own database
  • Suggested privacy policy wording added to Settings Privacy

Works with page caching

Many popular-post plugins only count visits that reach PHP, so they miss most views on cached sites. Tivy Popular Posts counts from the browser with a tiny script (under 1 KB, no jQuery), so it works with Cloudflare, WP-Optimize, WP Rocket and other caches.

Accurate counts

  • Known bots and crawlers are ignored
  • Each post is counted once per visit, however many times it’s reloaded
  • Your own visits aren’t counted while you’re logged in as an editor or administrator
  • Prerendered pages are only counted if the visitor actually opens them

Flexible display

  • Any period: today, this week, this month, this year or all time
  • Numbered or plain list, with or without featured images and view counts
  • Posts, pages or any public post type
  • Leave out the post being read, or specific posts
  • Your front page and posts page are left out automatically
  • A block, a shortcode and PHP template tags
  • Inherits your theme’s fonts and colours

View counter on posts

Show “1,234 views” on each post, automatically before or after the content, or wherever you like with the [tivy_post_views] shortcode.

Light on your database

One small row per post per day. Old rows are pruned automatically (after 400 days by default), and lists are cached for ten minutes.

Usage

[tivy_popular_posts]
[tivy_popular_posts number="10" days="7"]
[tivy_popular_posts days="0" show_views="yes"]
[tivy_popular_posts thumbnails="yes" style="list" exclude_current="yes"]

Attributes (all optional, defaults from Settings Popular Posts):

  • number: how many posts (1–50)
  • days: period in days; 1 = today, 0 = all time
  • post_type: comma list, e.g. post,page
  • show_views: yes or no
  • thumbnails: yes to show featured images
  • style: numbered or list
  • exclude: comma list of post IDs to leave out
  • exclude_current: yes to leave out the post being read
  • empty: text shown before any views are recorded
  • class: extra CSS classes
  • debug: yes shows administrators the attributes the shortcode received

View counter

[tivy_post_views] shows the current post's views. Attributes: `id` (another post), `days` (`0` = all time), `label` (`no` for just the number).

Template tags

<?php tivy_pp_popular_posts( array( 'number' => 5, 'days' => 7 ) ); ?>
<?php $items = tivy_pp_get_popular( array( 'days' => 30 ) ); ?> returns an array of `array( 'post' => WP_Post, 'views' => int )`.
<?php tivy_pp_post_views(); ?> echoes "1,234 views" for the current post; `tivy_pp_get_post_views( $post_id, $days )` returns the number.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums