Modify widget in child theme
-
Hello there,
I am trying to change the h-tags of a spezific widget of moesei pro. I have already read about the modification on google and on this side.
This is the code I’ve been trying to implement:
function moesia_child_widgets() {
if ( function_exists(‘siteorigin_panels_activate’) ) {
unregister_widget( ‘Moesia_Latest_News’ );
register_widget( ‘Moesia_Latest_Newsnew’ );
}
}
add_action( ‘widgets_init’, ‘moesia_child_widgets’, 99 );
require get_stylesheet_directory() . “/widgets/fp-latest-newsnew.php”;I have renamed the fp-latest-news in the child theme folder to fp-latest-newsnew.
I also changed the name of the class from “Moesia_Latest_News” to “Moesia_Latest_Newsnew”.
Somehow the code unregisters the widget “Moesia_Latest_News” (as I want to). But it doesnt register the new widget “Moesia_Latest_Newsnew”.What am I doing wrong?
Is there an easier way to solve the problem?
- The topic ‘Modify widget in child theme’ is closed to new replies.