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
Ciao
Alessandra
OnPoint Plugins
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.
OnPoint Plugins
Hi Alessandra,
I wanted to stop in to let you know that version 9 or this plugin is now available which supports Gutenberg blocks.
Enjoy!