
內容簡介
使用shortcode將小工具或多個小工具或整個小工具區域(側邊欄)插入到頁面中。
首先在正常的側邊欄中設置小工具。 檢查它是否正常運作。
然後將所選小工具拖到名為“用於shortcode的小工具”的側邊欄中。
將do_widget shortcode添加到要顯示小工具的頁面上(或添加do_widget_area)
使用塊編輯器,添加shortcode塊,然後輸入(包括方括號[do_widget widgetname]或從“Shortcodes for Shortcodes”側邊欄中的小工具複製do_widget提示。
請參閱安裝選項卡下的shortcode和參數的詳細信息(取決於插件目錄開發人員最近的操作,這可能在常見問題解答下,或至少在自述文件下)
多次使用小工具?
從do_widget shortcode中引用特定小工具實例,或從do_widget_area shortcode中選擇側邊欄。例如:[do_widget id=widget-n]
例如:您可以在頁面中使用查詢文章小工具來創建存檔,或使用rss小工具列出來自其他站點的餵養內容。有關詳細信息,請參閱anmari.com
該插件的默認操作是它會自動查找您的主題側邊欄的設置並使用側邊欄HTML來控制小工具輸出。在大多數情況下,這意味著小工具將按照您主題的其他部分進行樣式設置。如果效果不佳,則存在參數以嘗試覆蓋此行為。
例如,在2014年的主題中,小工具文本最終成為白色在白色上! widget_classes = none可以解決這個問題。例如:[do_widget widget_classes = none yourwidget]
更改主題並擔心失去側邊欄設置嗎?
沒問題,插件將保存並恢復widgets_for_shortcode設置。在顯示時,它將接收新主題的側邊欄設置。
注意:
請在啟用此插件之前在側邊欄中獲取您的小工具,並請閱讀https://wordpress.org/plugins/amr-shortcode-any-widget/installation/和https://wordpress.org/plugins/amr-shortcode-any-widget/faq/或參見設置頁面。要查看側邊欄中小工具的列表,請將?do_widget_debug添加到帶有do_widget shortcode的頁面中。
外掛標籤
開發者團隊
原文外掛簡介
Insert a widget or multiple widgets or a entire widget area (sidebar) into a page using a shortcode.
Set up your widget first in a normal sidebar. Check it works.
THEN Drag your chosen widgets to the sidebar called “widgets for shortcode”.
Add the do_widget shortcode to the page where you would like the widget to appear (or the do_widget_area)
To use in the block editor, add a shortcode block, then type in (including the square brackets [do_widget widgetname] or copy the do_widget tip from the widget in the ‘Widgets for Shortcodes’ sidebar.
Please see detailed info on shortcodes and parameters under the installation tab (depending what the plugin directory developers have most recently done, this may be under the FAQ, or at the very least under the readme.)
Using a widget more than once?
Reference a specific widget instance from the do_widget shortcode, or the chosen sidebar from the do_widget_area shortcode. Eg: [do_widget id=widget-n]
For example: You could use the query posts widget in the page to create a archive within a page, or the rss widget to list feed content from other sites. For more details see anmari.com
The plugins default action is that it will magically find the settings for your themes sidebar and use the sidebar html to control the widgets output. In most cases this means the widget will be styled as per the rest of your theme. If that does not look good, parameters exist to try override this behaviour.
EG: in twenty-fourteen theme widget text ends up being white on white! widget_classes=none fixes that. Eg: [do_widget widget_classes=none yourwidget]
Changed your theme and worried about losing the sidebar settings ?
No problem, the plugin will save and restore the widgets_for_shortcode settings. On display it will then pick up the new themes sidebar settings.
Note:
PLEASE get your widgets working in a sidebar BEFORE activating this plugin, and please read https://wordpress.org/plugins/amr-shortcode-any-widget/installation/ and https://wordpress.org/plugins/amr-shortcode-any-widget/faq/ and/or see the settings page. To see a list of your widgets in their sidebars, add ?do_widget_debug to the page with the do_widget shortcode.
