| 开发者 | littycojp |
|---|---|
| 更新时间 | 2026年11月7日 23:34 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[emiano_ranking] shortcode. Each one shows up to ten posts for one period and one post type, optionally filtered by one category, including posts in child categories./?p=123).[emiano_ranking period="1w" post_type="post"]
period: one of the periods selected on the settings screen (12h, 1d, 3d, 1w, 1m, 3m, 6m). If omitted, the shortest selected period is used.post_type: one public post type. Default: post.category: one category slug, including posts in child categories. If omitted, all categories are included.emiano_ar_get_ranking( $args ): accepts the same arguments as the shortcode (period, post_type, category) and returns an array of post IDs in ranking order, up to ten posts.emiano_ar_ranking_post_ids: filter receiving the array of candidate post IDs and the arguments. Applied before filtering by post type and category. Use it to exclude or reorder posts.emiano_ar_ranking_html: filter receiving the HTML, the array of displayed post IDs, and the arguments. Applied to shortcode and block output, but not to the text shown when there is no data.[emiano_ranking] shortcode to a post, page, or widget area.No. The plugin uses the data that your GA4 property already collects. GA4 itself must be installed on your site separately.
GA4 makes recent data available through its API after a delay of usually 2 to 6 hours, and the plugin retrieves data on a schedule. See "About GA4 data" above.
Check the retrieval status on the settings screen. Rankings appear after the first successful retrieval. The plugin uses WP-Cron, which runs when your site receives visits. Also check that the ranking's period is selected on the settings screen.
If WP-Cron is disabled (DISABLE_WP_CRON) or loopback requests are blocked, call wp-cron.php from your server's cron or use ALTERNATE_WP_CRON.
Google returns the same error when the property ID is wrong and when the service account has no access to the property. Check both.
The key is saved in your site's database, in the emiano_ar_settings option, which is not autoloaded and is not exposed through the REST API. It is never displayed again after saving; the settings screen shows only the service account email address. Leave the key field empty to keep the saved key. Use a service account that only has the Viewer role on the GA4 property.
Yes. With Plain permalinks, the plugin asks GA4 for the page path including the query string (for example /?p=123) and matches it to the post.
Private posts, drafts, scheduled posts, and trashed posts are never shown. A post that is made private after retrieval is hidden immediately. Password-protected posts are shown with their protected title, in the same way as WordPress post lists.
The settings (including the service account key), the stored rankings, the retrieval status, the cached access token and time zone, and the scheduled events.
category shortcode attribute.emiano_ar_get_ranking() function and the emiano_ar_ranking_post_ids and emiano_ar_ranking_html filters.