Sidebar widgets – adding to page and wrapping in shortcodes

  • Hi,
    1. Can i display a sidebar widget in a page content area?

    2. Can I wrap a sidebar widget within a shortcode?
    eg if I have a custom shortcode that only displays to logged in user from france call [showtousers region=france]content here[/showtousers]

    Many thanks
    Ben

  • Hi Ben,

    Just to be sure we guide you the right way:

    1. When you say “display a sidebar widget in a page content area,” do you mean you’d like to take an existing widget from Appearance → Widgets and place it inside the content editor of a page?
    2. For the shortcode example, do you want the entire widget output to be wrapped inside your shortcode, so it only shows for certain users/regions?
  • Hi Chaz,
    Correct on all counts.
    1. YES, Can I display a widget from Appearance → Widgets and place it inside the content editor of a page
    2. YES, the entire widget output to be wrapped inside your shortcode, so it only shows for certain users/regions

    Thanks
    Ben

  • 1. YES, Can I display a widget from Appearance → Widgets and place it inside the content editor of a page

    It depends on whether this widget offers blocks. If so, then yes, you can add the block to the content area. If the widget is from 3rd party plugin, you will need to check with the plugin’s support.

    2. YES, the entire widget output to be wrapped inside your shortcode, so it only shows for certain users/regions

    I don’t think so, unless you know how the widget is coded, so you can add the code into your shortcode code.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.