Okay
  Public Ticket #2023155
Replacing widgets in functions.php
Closed

Comments

  • asderferjerkel started the conversation

    Hey,

    I've edited my footer to add an extra row under a few of the columns using a child theme, replacing /nectar/helpers/widgets.php and /includes/partials/footer/main-widgets.php. I included it in the child functions.php with this:

    require_once( get_stylesheet_directory() . '/nectar/helpers/widgets.php');

    But that gives a PHP error:

    PHP Fatal error:  Cannot redeclare register_nectar_popular_posts_widget()

    as it doesn't replace the existing require_once in the parent theme's functions.php. To get it to work I've had to comment out the parent "Widget areas and custom widgets". Would it be possible for you to update /nectar/helpers/widgets.php so it checks if the functions already exist (i.e. if a child theme has defined them), so I don't need to comment it out on every update?

    Thanks!

  •  8,994
    Tahir replied

    Hey,

    We have a new Version coming out which has been completely rewritten so this would likely be taken care of as well.

    Best 


    ThemeNectar Support Team 

  • asderferjerkel replied

    Thanks for the quick reply! :)

  • asderferjerkel replied

    Hi again! I've just upgraded to 10.5 (looks great!) but have the same issue, albeit having to comment out /nectar/helpers/widget-related.php instead. Would you mind taking a look if you have time please?

    Thanks!

  •  8,994
    Tahir replied

    Sure, Gonna escalate the Ticket to the Developer. 

    Best 


    ThemeNectar Support Team