How to create a wordpress widget that dynamically changes according to the page
register_widget() doesn’t make any changes to the database. All it does is make a particular widget available to be used. It shouldn’t be used on the dynamic_sidebar hook. It’s supposed to be used on the widgets_init hook. If you want the contents of a widget to change depending on the current page, then that logic … Read more