Support » Theme: MH Magazine lite » Adding edited widget code to child theme

  • Resolved globe.editor



    I’m in the process of adding a child theme for our site. We use MH magazine lite

    In the original mh-widgets file the code was changed for sections Home 1 (updated title position, changed slider navigation, shows excerpt, etc.) and Home 2 (spans 2 columns, removed blank box for no thumbnails) among other things.

    You can see the changes at

    I have pulled the edited code from the original mh-widgets into a separate file in the child theme, and using this reference page I tried this code:
    require_once( get_stylesheet_directory() . '/my_included_file.php' );
    and I point it to the mh-widgets php file in my child theme but I get a “Fatal error: Cannot redeclare” error that crashes the site.

    For the time being the edited code has been left in the main theme which is not ideal.

    My main question is what or how can I reference the edited widget code in the child theme?

    Thanks for your time.

Viewing 1 replies (of 1 total)
  • Hi globe.editor,

    thanks for using MH Magazine lite.

    Your problem probably is caused because you have included the class of the modified widgets with the same class name as the original widgets which is causing a conflict.

    You can either change the class name for your widgets and include them as new additional widgets or unhook/unregister the original widgets and then hook/register your version of the widgets.

    But please notice that we can’t offer help with theme customizations for free as this is beyond regular theme support which is already free for this theme.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding edited widget code to child theme’ is closed to new replies.