• Resolved FadingMusic

    (@fadingmusic)


    Hello,

    I customized the alx-posts and alx-tabs widgets and I would like to use them in my child theme. However, if I upload them both to /child-theme/functions/widgets/, it won’t override those widgets. How can I do this?

    Thank you.

    • This topic was modified 7 years, 7 months ago by FadingMusic.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi fadingmusic. Sounds like the widgets are still being loaded from the parent theme. Copy the function hu_load() from /functions/init-core.php to your child theme and change the load_template target for the widgets:

    function hu_load() {
        // Load theme languages
        load_theme_textdomain( 'hueman', get_stylesheet_directory().'/languages' );
    
        // Load theme options and meta boxes
        // load_template( get_template_directory() . '/functions/theme-options.php' );
        load_template( get_template_directory() . '/functions/init-meta-boxes.php' );
    
        // Load custom widgets
        load_template( get_stylesheet_directory() . '/functions/widgets/alx-tabs.php' );
        load_template( get_template_directory() . '/functions/widgets/alx-video.php' );
        load_template( get_stylesheet_directory() . '/functions/widgets/alx-posts.php' );
    
        // Load dynamic styles
        load_template( get_template_directory() . '/functions/dynamic-styles.php' );
    
        //Load compatibility plugins functions
        load_template( get_template_directory() . '/functions/plugins-compatibility.php' );
    }
    Thread Starter FadingMusic

    (@fadingmusic)

    Hello bdbrown,
    That worked perfectly, thank you! 🙂

    You’re welcome.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding widgets to child theme’ is closed to new replies.