| 开发者 | |
|---|---|
| 更新时间 | 2026年2月17日 21:33 |
| PHP版本: | 5.6 及以上 |
| WordPress版本: | 6.9.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[smk_sidebar id="your-sidebar-id"]
Developer Friendly
Use PHP functions in your theme templates:
`<?php
// Display sidebar by ID
if ( function_exists( 'smk_sidebar' ) ) {
smk_sidebar( 'your-sidebar-id' );
}
// Or use WordPress native function
dynamic_sidebar( 'your-sidebar-id' );
// Get all registered sidebars
$sidebars = smk_get_all_sidebars();
?>`
Perfect For
smk-sidebar-generator folder to /wp-content/plugins/Yes! Use the shortcode [smk_sidebar id="your-sidebar-id"] in any text widget or shortcode module. You can find each sidebar's shortcode displayed in its settings panel.
No. SMK Sidebar Generator is lightweight and only loads its assets on the admin pages where needed. On the frontend, it simply filters which sidebar to display with minimal overhead.
Yes! The plugin works with any properly coded WordPress theme. Your generated sidebars will automatically inherit your theme's sidebar styling.
Yes, use either method in your theme template files:
<?php smk_sidebar( 'your-sidebar-id' ); ?>
Or the native WordPress function:
<?php dynamic_sidebar( 'your-sidebar-id' ); ?>
The sidebar ID is displayed in each sidebar's settings panel, along with the shortcode. You can also use smk_get_all_sidebars() to get an array of all sidebar IDs and names.
Yes! When adding conditions, select the post type archive or use taxonomy conditions to target specific categories, tags, or custom taxonomies.
Yes! You can create shop-specific sidebars and use conditions to display them only on WooCommerce pages like the shop, product pages, cart, or checkout.
Yes! The plugin is translation-ready. You can contribute translations on translate.wordpress.org or create your own using the included POT file.
Please use the GitHub Issues page for bug reports and feature requests.
smk_get_all_sidebars() helper function