| 开发者 |
myndsyn
ronknight |
|---|---|
| 更新时间 | 2026年8月27日 12:53 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[ytsub] shortcode. The block works in posts, pages and the Site Editor, so you can drop it into a header, footer or sidebar template, or sit it in a Row next to core's Social Icons block as one more social button.
Site-wide defaults are configured under Settings > YT Sub Counter:
[ytsub theme="dark" count="hidden"].
The "Youtube Subscribers" widget is still included and existing widgets keep working, but it is legacy. Block themes have no widget areas at all, so the block is the way to place the button there.
/wp-content/plugins/show-youtube-subscribers-count directory, or install the plugin through the WordPress plugins screen directly.[ytsub] shortcode.Check that a Channel ID is set under Settings > YT Sub Counter, or directly on the block, shortcode or widget. The button is not rendered when no channel is configured.
Make sure you've entered a valid YouTube Channel ID, not a custom URL or a handle beginning with @. Your Channel ID is the string starting with "UC" shown at https://www.youtube.com/account_advanced
Block themes, including the recent default WordPress themes, do not have widget areas, so the Widgets screen does not exist for them. Use the "YouTube Subscribe" block instead. In the Site Editor you can add it to any template, including headers and footers, which is where a sidebar widget would once have gone.
Add a Row block, put core's Social Icons block in it, then add the "YouTube Subscribe" block beside them. The Row's alignment controls will line them up. The subscribe button is rendered by YouTube, so it keeps YouTube's own styling rather than inheriting your social icon colours.
Existing widgets keep working and there is no plan to remove the widget. It is no longer the recommended way to add the button, because WordPress itself has moved on from widget areas.
Yes. Set the channel on the shortcode itself, for example [ytsub channel="UCxxxxxxxxxxxxxxxxxxxxxx"]. Any shortcode attribute overrides the site-wide setting.
channel, layout (default or full), theme (default or dark) and count (default or hidden). Anything you omit falls back to the setting saved under Settings > YT Sub Counter.