该插件尚未通过WordPress的最新3个主要版本进行测试。 当与较新版本的WordPress一起使用时,可能不再受到维护或支持,并且可能会存在兼容性问题。

Widget Shortcode

描述

The shortcode requires the widget ID, but no need to guess, the plugin generates the code for you. To override the widget title for a widget you can use the “title” parameter:
[widget id=”text-1″ title=”New title”]
You can also hide the widget title entirely if desired:
[widget id=”text-1″ title=”0″]

Additional Parameters:

  • container_tag: the HTML tag to use for the widget container, default: div
  • container_class: CSS classname added to the widget container, default: widget %2$s (Note: uses sprintf for variable substitution)
  • container_id: HTML ID attribute for the widget container, default: %1$s (Note: uses sprintf for variable substitution)
  • title_tag: HTML tag to use for the widget title wrapper, default: h2
  • title_class: CSS classname for the widget title wrapper, default: widgettitle

屏幕截图

  • The plugin generates the shortcode for you
  • The shortcode generator in TinyMCE editor
  • The new Widget Shortcode block in Gutenberg

区块

该插件提供了1个区块.

  • Widget Shortcode

安装

  1. Upload the whole plugin directory to the /wp-content/plugins/ directory
  2. 通过WordPress的“插件”菜单激活插件
  3. That’s it. Use the [widget] shortcode anywhere you want
  4. Enjoy!

评价

2021年2月3日
I had tried another plugin to use a widget in the gutenberg block editor on a page, however that plugin had some issues so was not ideal. Widget shortcode enabled me to add my widget by copying the generated shortcode to the shortcode block in the block editor, resulting in the widget being displayed perfectly on the page.
2021年1月13日
Its a great little plugin. Quite useful thing to have on your site for easy customization. I hope the author will keep it updated and in-line with future wordpress releases.
2020年11月2日
Works perfectly, I hope the author will keep this great plugin up to date! Thanks !
阅读所有66条评价

贡献者及开发者

“Widget Shortcode” 是开源软件。 以下人员对此插件做出了贡献。

贡献者

“Widget Shortcode”插件已被翻译至13种本地话语言。 感谢所有译者为本插件所做的贡献。

将“Widget Shortcode”翻译成您的语言。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

0.3.5

  • Add support for the Additional CSS Classes field in Gutenberg

0.3.4

  • New Gutenberg block

0.3.3

  • Additional CSS classes to the widget wrapper

0.3.2

  • Fix bug with getting correct widget instance. Thanks @frankieandshadow!

0.3.0

  • Fix possible notice message

0.2.9

  • Fix notice messages regarding unregistered widgets

0.2.8

  • Fix bug where widget titles do not show. Thanks @websitedons!

0.2.7

  • update how the shortcode code is displayed to avoid potential problems; thanks @websitedons!

0.2.6

  • Fix for possible notice message
  • Additional parameters to control the widget output

0.2.5

  • Fix notice message if widget is inactive

0.2.4

  • Shortcode generator in TinyMCE
  • i18n
  • Minor code refactoring

0.2.3

  • Fixed missing widget classes and ID from before_widget

0.2.2

  • Fixed a bug with removing titles from widget
  • Compatibility with Widget Title Links and other plugins that change the widget args

0.2.1

  • Added the ability to override the widget title in shortcode
  • Support for filtering the default widget args
  • Cleared the PHP notice

0.2

  • Added do_widget function
  • Added the ‘title’ option which enables to suppress the widget title