| 开发者 | s7ntech |
|---|---|
| 更新时间 | 2026年4月14日 03:22 |
| PHP版本: | 7.2 及以上 |
| WordPress版本: | 6.8 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
#, social-style.[s7n_tag_display] or [s7n_tag_display template="minimal"].tag-display folder to the /wp-content/plugins/ directory.[s7n_tag_display] to any post or page.Activate the plugin, then go to Tag Display in the main WordPress menu to pick a template and configure colors. From there, add tags to your posts in one of three ways:
[s7n_tag_display] into any post or page.Yes. Choose between Default, Minimal, Cloud, Outlined, and Hashtag templates:
[s7n_tag_display template="outlined"]In the block editor, click the + button and search for "Tag Display". Add the block to your post. Use the sidebar panel (Display Settings, Link Options, Title) to override the template, ordering, tag limit, and other options for that specific block - independently of the global settings.
All attributes are optional and override the global settings for that specific instance:
[s7n_tag_display template="hashtag" order="count_desc" max="8" exclude="news,draft" nofollow="true" new_tab="true" show_count="true" title="Related topics:"]
template - default, minimal, cloud, outlined, hashtagorder - alpha_asc, alpha_desc, count_desc, count_asc, random (default: global setting)max - maximum number of tags to show, e.g. max="5" (0 = all)exclude - comma-separated slugs to hide, e.g. exclude="news,uncategorized"nofollow - true to add rel="nofollow" to tag linksnew_tab - true to open links in a new tabshow_count - true to show the post count next to each tag, e.g. WordPress (12)title - custom label above the tags, e.g. title="Topics:" (empty string hides the title)Open Tag Display → General Settings:
In Tag Display → General Settings → Exclude Tags, enter the slugs (not names) of the tags you want to hide, separated by commas. Example: news, uncategorized, draft.
To find a tag's slug, go to Posts → Tags in the WordPress admin.
Yes. Go to Tag Display → Content Types, enable auto-display for posts, pages, or custom post types, and choose whether tags appear before or after the content.
Go to Tag Display → General Settings and enable the rel="nofollow" or Open in new tab checkboxes. These can also be set per-instance via shortcode (nofollow="true", new_tab="true") or Gutenberg block sidebar.
Yes. Place a file named tag-display-template-{name}.php in your theme (or child theme) root folder, where {name} is the template you want to override: default, minimal, cloud, outlined, or hashtag.
Example: to override the default template, create wp-content/themes/your-theme/tag-display-template-default.php.
The plugin picks it up on the next page load. A commented example file is included in the plugin's examples/ folder.
The following variables are available in your custom template:
$tags - array of WP_Term objects (->name, ->slug, ->count)$display_title - label text above the tags$display_nofollow - boolean, whether to add rel="nofollow"$display_new_tab - boolean, whether to open links in a new tab$display_show_count - boolean, whether to show post count next to each tagSmart Visibility automatically adapts tag display based on how many tags a post has - improving both SEO and user experience. When the count falls below a configurable threshold, the plugin applies the behavior you choose:
display:none so they are present in the DOM but invisible. Useful when you want to toggle them via JavaScript without a page reload.[s7n_tag_display smart="true" min="3" behavior="collapse"]
smart - true to enable, false to force-disable for this instance regardless of the global settingmin - minimum tag threshold for this instancebehavior - hide, hidden, collapse, or seo; use force to bypass Smart Visibility entirely for this instanceTested up to WordPress 6.8. If you run into a compatibility issue, open a thread on the support forum.
mode arg now respected in is_enabled() and is_below_threshold().data-track-tag and data-track-post attributes when tracking is enabled.replace: when tags are below threshold, a related posts list is shown instead (WP_Query cascade: shared tags then shared categories, up to 5 results, transient-cached 1h).tag-display-related-posts.php with configurable title via admin field.set_object_terms hook)..s7n-related-posts (neutral, theme-inheriting, responsive).display:none (DOM present, togglable via JavaScript) without a full PHP re-render.[s7n_tag_display smart="false"] or behavior="force" disables Smart Visibility for a single instance..pot and it_IT.po/.mo.tag-display-template-{name}.php in your theme folder to fully customize the output.examples/tag-display-template-custom.php with a fully commented template starter.