OnPoint Plugins

  • Plugins
    • Advanced Sidebar Menu
    • Go Live Update Urls
  • About
    • Services
    • Showcase
  • Blog
  • Contact
  • Support
  • Log In
← Back to support

Use widget in pages and/or Toolset views

Resolved

Requested: 3 weeks and 4 days ago

Hello, I’d like to add your “Advanced Sidebar – Pages” widget into the post content, using Gutenberg (or Toolset Views). The widget should show my custom post types called “Devices”.

As far as I know, I have to add a shortcode in my functions.php file:

 add_shortcode(‘add_widget_to_view_template’, ‘widget_to_view_template’);
 function widget_to_view_template($atts, $content = ”) {
    return the_widget( ‘Advanced_Sidebar_Menu’ );
}
 
then add [add_widget_to_view_template] in the post content. 
 
Unfortunately, this solution is not working, I can’t see any output in the frontend. I think I should add some parameters in the the_widget() function, but I can’t figure out how.
Can you please help me with this issue?
Ciao
Alessandra

Plugin: Advanced Sidebar Menu

  1. OnPoint Plugins

    3 weeks and 4 days ago

    Hi Alessandra,

    Assuming your “Devices” custom post type’s slug is “devices”, the widget may be output using your shortcode by making some adjustments to the code.

    You may include any of the widget settings within the above array.

    Have a great day!

    P.S. We are currently working on adding Gutenberg blocks for the widgets and expect to have blocks available sometime in August.

New Response Cancel reply

You must be logged in to respond. Only PRO members are allowed to respond to support requests.

© 2022 · WordPress Development · Terms Of Service · Privacy Policy · Cookie Policy · Log in

  • Plugins
  • Blog
  • Contact