Plugin Won’t Work.
-
Hello there,
I did tried your plugin,
But it seems that it’s not working, unfortunately,.
After activating the plugin, it is not letting the widgets save.
I’m using “Prasoon” theme. Leaving it here as a feedback.
ThanksTopic link: https://wordpress.org/support/topic/about-us-plugin-along-with-slideshow-in-the-right-widget/
-
Souvik,
Thank you for you feedback. I installed the Prasoon theme, and I think I know why it doesn’t work.
But first, just to clear things up, are you able to save data onto a widget? For example, if you add the Search widget and update the title, does it save your change when you click “Save”? I ask, because if the widget data is not being save to the database, there might be another issue altogether.
With that said, I did notice a couple of incompatibility issues with the Prasoon theme. The first is with the way Prasoon registers sidebars. There are two sidebars registered by the theme, the “Sidebar” widget area, and the “Business Template” widget area. The first sidebar is registered correctly with a
before_widgetandafter_widgetparameters, but the second sidebar (Business Template) doesn’t specify those parameters and are left empty (please refer to thefunctions.phpfile and take a look at theprasoon_widgets_initfunction starting in line 134).As stated on my plugin FAQs “This plugin only works with registered sidebars that have an HTML element assigned to the
before_widgetandafter_widgetparameters. If these parameters are empty, the plugin will not work. In addition, the before_widget parameter must have a class attribute associated with it so the plugin can inject the column classes accordingly.”The second compatibility issue is with the way all Prasoon widgets are registered. None of them echo the
$before_widgetand$after_widgetparameters in their markup. So even if you fix the sidebar registration function (see below), the Prasoon widgets are still not using them in their markup so you still wouldn’t get the columns classes assigned to those specific widgets.To accomplish your original task, you could edit the
prasoon_widgets_initfunction, but will have to use widgets that output the$before_widgetand$after_widgetparameters in their markup such as the WordPress default widgets, or other third-party widgets that make use of those parameters since the Prasoon widgets are incompatible.Here is the amended
prasoon_widgets_initfunction:/** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ if ( ! function_exists( 'prasoon_widgets_init' ) ) : function prasoon_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'prasoon' ), 'id' => 'main-sidebar', 'description' => esc_html__( 'Add widgets here.', 'prasoon' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>', ) ); register_sidebar( array( 'name' => esc_html__( 'Business Template.', 'prasoon' ), 'id' => 'business-sidebar', 'description' => '', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '', 'after_title' => '', ) ); } endif; add_action( 'widgets_init', 'prasoon_widgets_init' );For more information registering sidebars, please refer to this page: Registering a Sidebar.
I hope this can help you solve your original problem.
Cheers.
Hey Alexis,
Thank you for the elaboration.
As you mentioned at the very first, I am unable to save widget, and that’s where the problem is taking place.So, what’s the easiest solution, I wanted to know.
Thanks!!Hi Souvik,
Unfortunately there could be many things causing the widgets not saving to the database error. I have the Prasoon theme installed with Easy Widget Columns and everything is saving fine on my end, so it tells me it might not be a theme issue, but rather a conflict with another plugin.
Are you able to save plugins again if you deactivate Easy Widgets Columns? Try deactivating all plugins except for Easy Widget Columns and see if the problem still persists. If it works as expected, then start reactivating the other plugins one by one testing the widgets every time until it breaks again. If you can pinpoint the conflicting plugin, please send me the name so I can try to replicate the issue and see if I can find a fix.
Thank you.
Hi Souvik,
Another user recently had a similar problem to yours and I was able to find a bug with the widget update callback filter which was short-circuiting the widget’s ability to save their settings in some server environments mainly those running PHP 7.
I issued an update that should fix the problem in version 1.2.1 of the plugin. Could you please update and confirm if the issue is fixed?
Cheers.
The topic ‘Plugin Won’t Work.’ is closed to new replies.