Using widget_inits hook and require breaks site
-
I am trying to unregister and register a new widget class, in order to use a child theme file. However, when I add the action Init_widget, or add the line to require the pathname, the site breaks and I get a server 500 error.
function moesia_child_widgets() { if ( function_exists('siteorigin_panels_activate') ) { unregister_widget( 'Moesia_Projects' ); register_widget( 'Moesia_Newprojects' ); } } add_action( 'widgets_init', 'moesia_child_widgets', 99 ); require get_stylesheet_directory() . '/widgets/fp-newprojects.php';
I have my fp-newprojects.php file in moesia-child-01/widget/fp-newprojects.php. I am using the Moesia theme.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Using widget_inits hook and require breaks site’ is closed to new replies.