El tema secundario de WordPress anula un tema principal incluido
Estoy creando un tema secundario de WordPress y necesito sobrescribir ciertas plantillas de widgets. Estoy intentando usar este método para anular la llamada al tema principal:La forma correcta de anular las funciones temáticas.
Sin embargo, actualmente recibo este error:
Error grave: no se puede volver a declarar hickory_homepage_load_widget () (declarado anteriormente en C: \ wamp \ www \ greenpeaceNewBlog \ wp-content \ themes \ gp-blog \ inc \ widgets \ homepage_widget.php: 8) en C: \ wamp \ www \ greenpeaceNewBlog \ wp-content \ themes \ hickory \ inc \ widgets \ homepage_widget.php en la línea 10
El tema padre functions.php llama a las plantillas de esta manera:
include("inc/widgets/homepage_widget.php");
El archivo homepage_widget.php contiene esto:
add_action( 'widgets_init', 'hickory_homepage_load_widget' );
function hickory_homepage_load_widget() {
register_widget( 'hickory_homepage_widget' );
}
Tengo un directorio de widgets duplicados de tema hijo (stylesheet_directory / inc / widgets / ..) y un tema hijo functions.php. En mi niño functions.php, he escrito esto:
// Remove the default Thematic blogtitle function
function remove_hickory_widgets() {
remove_action('widgets_init', 'hickory_homepage_load_widget');
}
// Call 'remove_thematic_actions' (above) during WP initialization
add_action('init','remove_hickory_widgets');
include("inc/widgets/homepage_widget.php");
Por favor ayuda :)
Aclamaciones