How to Fix a Broken Sidebar Caused by the EventON Widget
Last Updated: July 25, 2023
Does your website sidebar break after adding an EventON widget? Are all the widgets that come after the EventON widget showing up elsewhere on the page? If you’re experiencing any of these issues, don’t worry! We have a potential fix for you to try out.
Fix
To get started, we need to open the functions.php file, which is located in the “wp-content/themes/–” on your active theme’s folder.
Paste the below code anywhere in the functions.php file (the top part of the file would be better so you might not break any other functions)
1 2 3 4 5 6 7 8 9 10 11 12 13 |
add_action('eventon_before_widget', 'eventon_widget_fix'); add_action('eventon_after_widget', 'eventon_widget_fix'); add_action('eventon_before_widget_SC', 'eventon_widget_fix'); add_action('eventon_after_widget_SC', 'eventon_widget_fix'); function eventon_widget_fix(){ echo ""; } |
What’s the cause?
Some themes, as we have found out, try to hook into either only before or only after the widget actions. This breaks the HTML of the front-end widget. So the above code makes sure those injections through hooks are not added to the EventON widget.
Did this article help you? If not, send us a ticket via helpdesk