這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 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. Upload the whole plugin directory to the /wp-content/plugins/ directory
  2. Activate the plugin through the 『Plugins』 menu in WordPress
  3. That’s it. Use the [widget] shortcode anywhere you want
  4. Enjoy!

評價

2019年3月2日
Hi, this is really helping me out, thank you! Very nice that it is working with Gutenberg, inserting widgets in the content from a drop-down, no copy-pasting of shortcodes, and a preview inside the block editor! Just some minor glitches/enhancements: https://wordpress.org/support/topic/advanced-additional-css-class-broken-wp-5-1-gutenberg/ https://wordpress.org/support/topic/make-link-inside-widget-non-clickable-in-the-preview-in-the-editor/ https://wordpress.org/support/topic/make-additional-attributes-available-in-block-editor-gutenberg/ Fixing the first two of these, would totally earn you that fifth star—and a donation 😉 TIA
2018年11月10日
The plugin works really well and it feels very lightweight. I'm glad I stumbled upon this plugin long time ago and marked it as favorite, I thought 'um.. this looks interesting and it might come in handy sometime later. That time came working on a theme that strictly shows post grid throught the use of widgets but only in 'home', so with the help of this plugin I was able to put the post grid in any page I wanted. You just saved me hours of doing custom PHP code. Thank you!
閱讀全部58個評價

貢獻者及開發者

“Widget Shortcode” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

Widget Shortcode 外掛目前已有 4 個本地化語言版本。 感謝所有譯者為這個外掛做出的貢獻。

將 Widget Shortcode 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

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