Linux 软件免费装
Banner图

amr shortcode any widget

开发者 anmari
更新时间 2021年5月28日 18:50
WordPress版本: 5.7.2

标签

widget sidebar page shortcode templates page template widget_area

下载

3.6 3.7 3.5 4.0 3.9 3.8

详情介绍:

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.

安装:

  1. Test your chosen widget in a normal sidebar or widget area first.
  2. Then activate this plugin
  3. Go to Appearance > widgets and find the " widgets for shortcode" sidebar or widget area
  4. Drag your chosen widget from your normal sidebar to the shortcodes sidebar. Save.
  5. Now go to a page and enter a do_widget shortcode The shortcode any widget settings page has some helpful (hopefully) examples and links.
  6. [do_widget widgetname] eg: [do_widget calendar]
  7. [do_widget "widget name"]. eg: [do_widget "tag cloud"]
  8. [do_widget id=widgetid] . eg: [do_widget id=tag-cloud-3]
  9. [do_widget_area] (will use the "widgets in shortcodes" widget area / sidebar
  10. [do_widget_area sidebarid] or [do_widget_area widget_area=sidebarid] for another sidebar or widget area - eg: to maximise likelihood of getting your theme's widget css to apply.
[do_widget ...] Parameters: [do_widget_area ...] Parameters: Advanced users WARNING: using do_widget_area with a widget area other than the shortcode one means that if you changes themes and the new theme has different sidebars, then this shortcode with a named widget area will not work. See the settings page for links to help your create the shortcodes in a page. The plugin has been tested with most standard widgets (rss feeds, tag cloud, pages, meta, search, and of course my own plugins widgets - upcoming events list, calendar and user lists. If you use a widget more than once for different reasons, you may need to use the widget id to isolate which widget instance and it's settings to use. ie: [do_widget id=categories-6] . If you just use the name, it will display all widgets in the shortcode sidebar with that name (all instances). If you liked this plugin, you might also like my other plugins:

屏幕截图:

  • setting up widgets in the widgets for shortcode sidebar. The widget's user interface (UI) is used to provide a UI for the do_widget shortcode.
  • add shortcode for widgets in a page (must be in the widgets for shortcode sidebar)
  • widgets in a page
  • with the default widget class and with widget_classes=none
  • The widget id is now visible in the widget window
  • After clicking on debug message - scroll down till you see the shortcodes sidebar - the widgets and their ids will be listed. Find the id of the widget you want.
  • Shortcode parameters to remove widget-classes in theme like the twenty-fourteen theme (avoid white text on white background)
  • Example of multiple rss widgets in twenty-fourteen theme

更新日志:

Version 3.9 Version 3.8 Version 3.7 Version 3.6 Version 3.5 Version 3.4 Version 3.3 Version 3.2 Version 3.1 Version 3 Version 2.9 Version 2.8 Version 2.6 Version 2.5 Version 2.4 Version 2.3 Version 2.2 Version 2.1 Version 2 Version 1.8 Version 1.7 Version 1.6 Version 1.5 Version 1.4 Version 1.3 1.12 1.1 1.0