Insert a widget or multiple widgets or a entire widget area (sidebar) into a page using a shortcode.
使用简码将一个或多个窗口小部件或整个窗口小部件区域(边栏)插入页面。 p>
Set up your widget first in a normal sidebar.
首先在常规边栏中设置窗口小部件。
Check it works.
检查是否有效。
THEN Drag your chosen widgets to the sidebar called “widgets for shortcode”.
然后将您选择的窗口小部件拖到侧栏“短代码小工具”中。 p>
Add the do_widget shortcode to the page where you would like the widget to appear (or the do_widget_area)
将do_widget短代码添加到您希望小部件出现的页面(或do_widget_area) p>
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.
要在块编辑器中使用,请添加一个简码块,然后输入(包括方括号[do_widget窗口小部件名称]或从“短代码的窗口小部件”侧栏中的窗口小部件中复制do_widget提示。 p>
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.)
请在“安装”选项卡下查看有关短代码和参数的详细信息(取决于开发人员最近执行的插件目录的操作,这可能在FAQ中,或者至少在自述文件中)。 p>
Using a widget more than once?
多次使用一个小部件吗? p>
Reference a specific widget instance from the do_widget shortcode, or the chosen sidebar from the do_widget_area shortcode.
从do_widget短代码中引用特定的小部件实例,或从do_widget_area短代码中选择所选的边栏。
Eg: [do_widget id=widget-n]
例如:[do_widget id = widget-n] p>
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.
例如:您可以使用页面中的查询帖子小部件在页面内创建档案,或者使用rss小部件列出其他站点的提要内容。
For more details see anmari.com
有关更多详细信息,请参见 anmari.com p>
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.
插件的默认操作是,它将神奇地找到主题侧边栏的设置,并使用侧边栏html来控制小部件的输出。
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.
如果效果不好,则存在参数尝试覆盖此行为。 p>
EG: in twenty-fourteen theme widget text ends up being white on white!
EG:在二十四个主题小部件中,文本最终变成白色!
widget_classes=none fixes that.
widget_classes = none可解决此问题。
Eg: [do_widget widget_classes=none yourwidget]
例如:[do_widget widget_classes = none yourwidget] p>
Changed your theme and worried about losing the sidebar settings ?
更改了主题,担心丢失侧边栏设置吗? p>
No problem, the plugin will save and restore the widgets_for_shortcode settings.
没问题,该插件将保存并恢复widgets_for_shortcode设置。
On display it will then pick up the new themes sidebar settings.
在显示时,它将选择新的主题侧边栏设置。 p>
Note:
注意: strong> p>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/
在激活此插件之前,请先在边栏中使您的小部件工作,请阅读https://wordpress.org/plugins/amr-shortcode-any-widget/installation/和https://wordpress.org/plugins/
amr-shortcode-any-widget/faq/ and/or see the settings page.
amr-shortcode-any-widget / faq /和/或参阅设置页面。
To see a list of your widgets in their sidebars, add ?do_widget_debug to the page with the do_widget shortcode.
要在侧边栏中查看小部件列表,请在页面上添加?do_widget_debug和do_widget短代码。 p>